Skip to content

Commit 8699ea1

Browse files
authored
Messaging API Update - November 2021 (#316)
* Retrieve text entered in message stickers * Use max number of IDs to retrieve in single request
1 parent 903f8d6 commit 8699ea1

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

lib/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ export default class Client {
207207
do {
208208
const res = await this.http.get<{ userIds: string[]; next?: string }>(
209209
`${MESSAGING_API_PREFIX}/followers/ids`,
210-
start ? { start } : null,
210+
start ? { start, limit: 1000 } : { limit: 1000 },
211211
);
212212
ensureJSON(res);
213213
userIds = userIds.concat(res.userIds);

lib/types.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -523,9 +523,14 @@ export type StickerEventMessage = {
523523
| "ANIMATION_SOUND"
524524
| "POPUP"
525525
| "POPUP_SOUND"
526-
| "NAME_TEXT"
527-
| "PER_STICKER_TEXT";
526+
| "CUSTOM"
527+
| "MESSAGE";
528528
keywords: string[];
529+
/**
530+
* Any text entered by the user. This property is only included for message stickers.
531+
* Max character limit: 100
532+
*/
533+
text?: string;
529534
} & EventMessageBase;
530535

531536
export type Postback = {

test/client.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -375,7 +375,7 @@ describe("client", () => {
375375
});
376376

377377
it("getBotFollowersIds", async () => {
378-
const scope = mockGet(MESSAGING_API_PREFIX, "/followers/ids");
378+
const scope = mockGet(MESSAGING_API_PREFIX, "/followers/ids?limit=1000");
379379
const ids = await client.getBotFollowersIds();
380380
equal(scope.isDone(), true);
381381
});

0 commit comments

Comments
 (0)