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#uploadStickerFile

Notes:

    * Closes PR #430

References:

    * FR: https://github.com/yagop/node-telegram-bot-api/issues/407
    * PR: https://github.com/yagop/node-telegram-bot-api/pull/430
    * PR-by: @CapacitorSet
This commit is contained in:
CapacitorSet
2017-10-07 15:08:18 +03:00
committed by GochoMugo
parent a2d85b889a
commit 8fd243e6a8
5 changed files with 59 additions and 1 deletions

View File

@@ -1371,4 +1371,18 @@ describe('TelegramBot', function telegramSuite() {
});
});
});
describe('#uploadStickerFile', function sendPhotoSuite() {
before(function before() {
utils.handleRatelimit(bot, 'uploadStickerFile', this);
});
it('should upload a sticker from file', function test() {
const sticker = `${__dirname}/data/sticker.png`;
return bot.uploadStickerFile(USERID, sticker).then(resp => {
assert.ok(is.object(resp));
assert.ok(is.string(resp.file_id));
});
});
// Other tests (eg. Buffer, URL) are skipped, because they rely on the same features as sendPhoto.
});
}); // End Telegram