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

test: CopyMessage and getMyDefaultAdministratorRights

This commit is contained in:
danielperez9430 2024-02-21 00:58:40 +01:00
parent be25ec69d2
commit 8df6e6583e

View File

@ -1552,10 +1552,13 @@ describe('TelegramBot', function telegramSuite() {
can_invite_users: true, can_invite_users: true,
can_restrict_members: false, can_restrict_members: false,
can_pin_messages: true, can_pin_messages: true,
can_manage_topics: false,
can_promote_members: false, can_promote_members: false,
can_manage_video_chats: false, can_manage_video_chats: false,
is_anonymous: false, can_post_stories: false,
can_manage_topics: false, can_edit_stories: false,
can_delete_stories: false,
is_anonymous: false
})); }));
}); });
}); });
@ -2059,7 +2062,7 @@ describe('TelegramBot', function telegramSuite() {
}); });
}); });
it('should add reactions to message', function test() { it('should add reactions to message', function test() {
return bot.setMessageReaction(USERID, messageId, {reaction: Reactions, is_big: true }).then(resp => { return bot.setMessageReaction(USERID, messageId, { reaction: Reactions, is_big: true }).then(resp => {
assert.strictEqual(resp, true); assert.strictEqual(resp, true);
}); });
}); });
@ -2084,13 +2087,14 @@ describe('TelegramBot', function telegramSuite() {
let messageId; let messageId;
before(function before() { before(function before() {
utils.handleRatelimit(bot, 'copyMessages', this); utils.handleRatelimit(bot, 'copyMessages', this);
return bot.sendMessage(USERID, 'To be copyed').then(resp => { return bot.sendMessage(GROUPID, 'To be copyed').then(resp => {
messageId = resp.message_id; messageId = resp.message_id;
}); });
}); });
it('should copy messages from array', function test() { it('should copy messages from array', function test() {
return bot.copyMessages(USERID, [messageId]).then(resp => { return bot.copyMessages(USERID, GROUPID, [messageId]).then(resp => {
assert.strictEqual(resp, true); assert.ok(is.array(resp));
assert.ok(resp && resp.length === 1);
}); });
}); });
}); });