@ChanMbot 5.1

Im this update:

  • Self-destruct Timer!

Ok ok ok. So how it should work?

User: /md *Test* _message_

Bot: Test message

User: /rm1h

Bot: I’ll remove ⬆️ this ⬆ message // with reply to last bot message

Step 1.

Code:

bot.on([‘/rm1h’], function(msg) {

let id = msg.chat.id
let num1 = msg.message_id
let num2 = msg.chat.id
let sum = num1 – 1

return bot.sendMessage(msg.chat.id, “I’ll delete previous message in 1hour”).then(() => {
setTimeout(() => bot.
deleteMessage(id, sum).catch(console.log), 36000000);
});
});

Then we need to add more timers but it is easy to do we need to replace 36000000 with another numbers 🙂

Gj @BotDev

Leave a Reply

Your email address will not be published. Required fields are marked *