2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 06:16:07 +00:00

feat: Support Bot API v6.2 (#996)

* docs: Update readme and add Typescript types

* feat: getCustomEmojiStickers

* feat: Add getCustomEmojiStickers test + fix other test

* fix: docs

* docs: Update changelog + docs
This commit is contained in:
Daniel Pérez Fernández
2022-08-15 21:44:44 +02:00
committed by GitHub
parent c9b05e7996
commit fe4afd6533
5 changed files with 84 additions and 20 deletions

View File

@@ -1694,7 +1694,7 @@ describe('TelegramBot', function telegramSuite() {
assert.ok(is.object(resp));
assert.strictEqual(resp.name.toLowerCase(), STICKER_SET_NAME);
assert.ok(is.string(resp.title));
assert.ok(is.boolean(resp.contains_masks));
assert.ok(is.string(resp.sticker_type));
assert.ok(is.array(resp.stickers));
});
});
@@ -1706,12 +1706,34 @@ describe('TelegramBot', function telegramSuite() {
assert.ok(is.object(resp));
assert.strictEqual(resp.name.toLowerCase(), stickerPackName.toLowerCase());
assert.ok(is.string(resp.title));
assert.ok(is.boolean(resp.contains_masks));
assert.ok(is.string(resp.sticker_type));
assert.ok(is.array(resp.stickers));
});
});
});
describe('#getCustomEmojiStickers', function getCustomEmojiStickersSuite() {
const CHERRY_EMOJI_STICKERS_ID = ['5380109565226391871', '5431711346724968789'];
const STICKER_EMOJI_SET_NAME = 'CherryEmoji';
it('should get the custom emoji stickers', function test() {
return bot.getCustomEmojiStickers([CHERRY_EMOJI_STICKERS_ID[0]]).then(resp => {
assert.ok(is.array(resp));
assert.ok(is.object(resp[0]));
assert.ok(is.string(resp[0].set_name) && resp[0].set_name === STICKER_EMOJI_SET_NAME);
assert.ok(resp[0].custom_emoji_id === CHERRY_EMOJI_STICKERS_ID[0]);
});
});
it('should get 2 custom emoji stickers', function test() {
return bot.getCustomEmojiStickers(CHERRY_EMOJI_STICKERS_ID).then(resp => {
assert.ok(is.array(resp) && resp.length === 2);
assert.ok(is.object(resp[1]));
assert.ok(is.string(resp[1].set_name) && resp[1].set_name === STICKER_EMOJI_SET_NAME);
assert.ok(resp[1].custom_emoji_id === CHERRY_EMOJI_STICKERS_ID[1]);
});
});
});
describe('#addStickerToSet', function addStickerToSetSuite() {
before(function before() {