mirror of
https://github.com/yagop/node-telegram-bot-api
synced 2025-08-31 06:16:07 +00:00
src/telegram: Add deleteMessage method
References: * API deleteMessage method: https://core.telegram.org/bots/api#deleteMessage * PR: https://github.com/yagop/node-telegram-bot-api/pull/324 * PR-by: @JonasFowl * API v3: https://github.com/yagop/node-telegram-bot-api/issues/332
This commit is contained in:
@@ -875,6 +875,21 @@ describe('TelegramBot', function telegramSuite() {
|
||||
});
|
||||
});
|
||||
|
||||
describe('#deleteMessage', function deleteMessageSuite() {
|
||||
let messageId;
|
||||
before(function before() {
|
||||
utils.handleRatelimit(bot, 'deleteMessage', this);
|
||||
return bot.sendMessage(USERID, 'To be deleted').then(resp => {
|
||||
messageId = resp.message_id;
|
||||
});
|
||||
});
|
||||
it('should delete message', function test() {
|
||||
return bot.deleteMessage(USERID, messageId).then(resp => {
|
||||
assert.equal(resp, true);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe('#getUserProfilePhotos', function getUserProfilePhotosSuite() {
|
||||
const opts = {
|
||||
offset: 0,
|
||||
|
Reference in New Issue
Block a user