Skip to content

Commit

Permalink
Use max number of IDs to retrieve in single request
Browse files Browse the repository at this point in the history
  • Loading branch information
dlackty committed Dec 8, 2021
1 parent a7a0594 commit b2b0eb1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ export default class Client {
do {
const res = await this.http.get<{ userIds: string[]; next?: string }>(
`${MESSAGING_API_PREFIX}/followers/ids`,
start ? { start } : null,
start ? { start, limit: 1000 } : { limit: 1000 },
);
ensureJSON(res);
userIds = userIds.concat(res.userIds);
Expand Down
2 changes: 1 addition & 1 deletion test/client.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ describe("client", () => {
});

it("getBotFollowersIds", async () => {
const scope = mockGet(MESSAGING_API_PREFIX, "/followers/ids");
const scope = mockGet(MESSAGING_API_PREFIX, "/followers/ids?limit=1000");
const ids = await client.getBotFollowersIds();
equal(scope.isDone(), true);
});
Expand Down

0 comments on commit b2b0eb1

Please sign in to comment.