node-telegram-bot-api
node-telegram-bot-api copied to clipboard
EditMessageReplyMarkup 400 Bad Request: object expected as reply markup
When I tried to edit the inline keyboard buttons: This error always appears: Unhandled rejection Error: ETELEGRAM: 400 Bad Request: object expected as reply markup
My Code:
bot.editMessageReplyMarkup(messageID,{
reply_markup: {
inline_keyboard: [[
{
text: 'Set Credentials',
callback_data: 'GG',
url : 'https://override-webserver.herokuapp.com/viber?num='
},{
text: 'Intent Lists',
callback_data: 'intentList'
}
]]
}
})
because the object you need to pass, must be the reply_markup content, as stated by the official bot api
bot.editMessageReplyMarkup(messageID, {
inline_keyboard: [[ ... ]]
});
Still getting the same error until I got rid of messageID
bot.editMessageReplyMarkup( { inline_keyboard: [[ ... ]] });
worked for me, changing the last inline keyboard
I having the same problem, although I get rid of messageID.