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:
@@ -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
|
||||
|
Reference in New Issue
Block a user