2
0
mirror of https://github.com/yagop/node-telegram-bot-api synced 2025-08-31 14:25:57 +00:00

src/telegram: Add TelegramBot#sendMediaGroup()

References:

  * Telegram API documentation: https://core.telegram.org/bots/api#sendmediagroup
This commit is contained in:
GochoMugo
2017-12-20 11:59:39 +03:00
parent 584610baaf
commit 0781ae685d
4 changed files with 100 additions and 0 deletions

View File

@@ -1409,4 +1409,31 @@ describe('TelegramBot', function telegramSuite() {
});
// Other tests (eg. Buffer, URL) are skipped, because they rely on the same features as sendPhoto.
});
describe('#sendMediaGroup', function sendMediaGroupSuite() {
before(function before() {
utils.handleRatelimit(bot, 'sendMediaGroup', this);
});
it('should send group of photos/videos as album', function test() {
return bot.sendMediaGroup(USERID, [
{
type: 'photo',
media: `${__dirname}/data/photo.gif`,
},
{
type: 'video',
media: `${__dirname}/data/video.mp4`,
},
{
type: 'photo',
media: FILE_ID,
},
], {
disable_notification: true,
}).then(resp => {
assert.ok(is.array(resp));
assert.equal(resp.length, 3);
});
});
});
}); // End Telegram