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
What happened?
client.fetchJoinedSquareChatsはコメントで、
Fetches all square chats the user joined.と書かれているが、すべてを取得しているわけではなく、fetchMyEventsでlimit:200を設定してあり、それが上限である。
なので、すべて取得できるようにしたい。
linejs/packages/linejs/client/client.ts
Lines 150 to 171 in 423925e
ちなみに
Squareを取得するclient.fetchJoinedSquaresは、client.base.square.getJoinedSquaresを使用しているが、
同じようにSquareChatを取得するのにclient.base.square.getJoinedSquareChatsを使おうとすると以下のようになる
Error message or Bug description
Environment