2
0
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:
GochoMugo
2017-05-26 16:29:02 +03:00
parent 942fc4854b
commit cda9d8d597
3 changed files with 44 additions and 0 deletions

View File

@@ -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,