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

src/telegram: Add TelegramBot#getStickerSet()

References:

    * FR: https://github.com/yagop/node-telegram-bot-api/issues/407
    * PR: https://github.com/yagop/node-telegram-bot-api/pull/429
    * PR-by: @CapacitorSet, @libertylocked
This commit is contained in:
CapacitorSet
2017-10-07 14:50:25 +03:00
committed by GochoMugo
parent f4f015a621
commit a2d85b889a
5 changed files with 51 additions and 1 deletions

View File

@@ -26,6 +26,7 @@ if (!PROVIDER_TOKEN && !isCI) { // If is not running in Travis / Appveyor
const USERID = process.env.TEST_USER_ID || 777000;
const GROUPID = process.env.TEST_GROUP_ID || -1001075450562;
const GAME_SHORT_NAME = process.env.TEST_GAME_SHORT_NAME || 'medusalab_test';
const STICKER_SET_NAME = process.env.TEST_STICKER_SET_NAME || 'pusheen';
const timeout = 60 * 1000;
let portindex = 8091;
const staticPort = portindex++;
@@ -1355,4 +1356,19 @@ describe('TelegramBot', function telegramSuite() {
describe.skip('#answerShippingQuery', function answerShippingQuerySuite() {});
describe.skip('#answerPreCheckoutQuery', function answerPreCheckoutQuerySuite() {});
describe('#getStickerSet', function getStickerSetSuite() {
before(function before() {
utils.handleRatelimit(bot, 'getStickerSet', this);
});
it('should get the sticker set given the name of the set', function test() {
return bot.getStickerSet(STICKER_SET_NAME).then(resp => {
assert.ok(is.object(resp));
assert.equal(resp.name.toLowerCase(), STICKER_SET_NAME);
assert.ok(is.string(resp.title));
assert.ok(is.boolean(resp.contains_masks));
assert.ok(is.array(resp.stickers));
});
});
});
}); // End Telegram