node-telegram-bot-api
node-telegram-bot-api copied to clipboard
Can't edit message after a message that have {remove_keyboard : true}
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
This might be a Telegram side issue.
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.