0

I am currently using Telegram as a tool to start & watch/log a script with the node-telegram-bot-api. The idea is to have a text with 'Uploaded Files: 1/10' and then will be edited according to the status of the upload in the backend.

bot.sendMessage(telegramChatID, 'Uploaded Files: 1/10', {
    'disable_notification': true
});

But how do I get the message_id of the text sent by the bot so I can edit it later on? Thanks for any help!

cinemandre
  • 62
  • 8

1 Answers1

0

It should work for you:

bot.sendMessage(telegramChatID, 'Uploaded Files: 1/10', {
    'disable_notification': true
}).then((msg)=>{
    console.log(msg.message_id); // <-- Here you can save id to update message later
});
Flife.5
  • 16