node-telegram-bot-api icon indicating copy to clipboard operation
node-telegram-bot-api copied to clipboard

Can't edit message after a message that have {remove_keyboard : true}

Open Pater999 opened this issue 5 years ago • 2 comments

I can't edit message after sending message that have {remove_keyboard : true}. Without "reply_markup": {remove_keyboard : true} my code works. Why??

bot.sendMessage(chatId, "loading...", {
    parse_mode: "HTML",
    "reply_markup": {remove_keyboard : true}     
}).then((result) => {
   bot.editMessageText("messaggio", {
       chat_id: chatId,
       message_id: result.message_id,
       "reply_markup": { inline_keyboard: tastierina}
   })
})

I got error Unhandled rejection Error: ETELEGRAM: 400 Bad Request: message can't be edited

Pater999 avatar Nov 02 '19 12:11 Pater999

This might be a Telegram side issue.

kamikazechaser avatar Nov 03 '19 18:11 kamikazechaser

This error occurs because the edit is not generated by pressing a button. You have to add a button that works as an intermediary between the previous message and the message to edit.

I don't know why it doesn't let you edit a message regardless of whether you press a button or not, but this is how it works so far.

You can try to set a timer and see if something happens.

IscoV avatar Jul 20 '22 10:07 IscoV