diff --git a/src/telegram.js b/src/telegram.js index 9e26f44c..d0e88b6a 100644 --- a/src/telegram.js +++ b/src/telegram.js @@ -238,13 +238,13 @@ class TelegramBot extends EventEmitter { } _fixAddFileThumbnail(options, opts) { - if (options.thumb) { + if (options.thumbnail) { if (opts.formData === null) { opts.formData = {}; } const attachName = 'photo'; - const [formData] = this._formatSendData(attachName, options.thumb.replace('attach://', '')); + const [formData] = this._formatSendData(attachName, options.thumbnail.replace('attach://', '')); if (formData) { opts.formData[attachName] = formData[attachName]; diff --git a/test/telegram.js b/test/telegram.js index 404fe354..b79d1324 100644 --- a/test/telegram.js +++ b/test/telegram.js @@ -730,14 +730,14 @@ describe('TelegramBot', function telegramSuite() { assert.ok(is.object(resp.audio)); }); }); - it('should send an audio file with thumb', function test() { + it('should send an audio file with thumbnail', function test() { const audio = `${__dirname}/data/audio.mp3`; const thumbImg = `attach://${__dirname}/data/sticker_thumb.png`; - return bot.sendAudio(USERID, audio, { thumb: thumbImg }).then(resp => { + return bot.sendAudio(USERID, audio, { thumbnail: thumbImg }).then(resp => { assert.ok(is.object(resp)); assert.ok(is.object(resp.audio)); - assert.ok(is.object(resp.audio.thumb)); + assert.ok(is.object(resp.audio.thumbnail)); }); }); }); @@ -1916,7 +1916,7 @@ describe('TelegramBot', function telegramSuite() { utils.handleRatelimit(bot, 'setStickerSetThumbnail', this); }); - it('should set a sticker set thumb', function test() { + it('should set a sticker set thumbnail', function test() { const stickerThumb = `${__dirname}/data/sticker_thumb.png`; const stickerPackName = `s${CURRENT_TIMESTAMP}_by_${BOT_USERNAME}`;