Skip to content

bug: fetchJoindSquareChatsで、参加済みのすべてのSquareChatsが取得できていない #82

@usuraiyukito

Description

@usuraiyukito

What happened?

client.fetchJoinedSquareChatsはコメントで、Fetches all square chats the user joined.と書かれているが、
すべてを取得しているわけではなく、fetchMyEventsでlimit:200を設定してあり、それが上限である。
なので、すべて取得できるようにしたい。

/**
* Fetches all square chats the user joined.
*/
async fetchJoinedSquareChats(): Promise<SquareChat[]> {
const response = await this.base.square.fetchMyEvents({
limit: 200,
});
const squareChats: SquareChat[] = [];
for (const event of response.events) {
if (
event.payload.notifiedCreateSquareChatMember
) {
squareChats.push(
new SquareChat({
client: this,
raw: event.payload.notifiedCreateSquareChatMember.chat,
}),
);
}
}
return squareChats;
}

ちなみに
Squareを取得するclient.fetchJoinedSquaresは、client.base.square.getJoinedSquaresを使用しているが、
同じようにSquareChatを取得するのにclient.base.square.getJoinedSquareChatsを使おうとすると以下のようになる

error: Uncaught (in promise) RequestError: Request internal failed, getJoinedSquareChats(/SQ1) -> {"errorCode":"NOT_IMPLEMENTED","reason":"NO XLT:Not yet implemented"}

Error message or Bug description

Environment

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions