Bug Report
I have read:
I am using the latest version of the library.
Edit the message with the new Inline Keyboard
{ reply_markup: '{"inline_keyboard":[[{"text":"Instagram Story","callback_data":"v1"}],[{"text":"WhatsApp Videos","callback_data":"v2"}],[{"text":"Anleitung","callback_data":"v3"}]],"resize_keyboard":true,"parse_mode":"Markdown"}' }
Unhandled rejection Error: ETELEGRAM: 400 Bad Request: object expected as reply markup
I send the you the new_inline_video variable output at runtim of the script above and the associated error i got.
let new_inline_video;
if(l_key == 'german'){
new_inline_video = {
reply_markup: JSON.stringify({
inline_keyboard: [
[{text: 'Instagram Story', callback_data: 'v1'}],
[{text: 'WhatsApp Videos', callback_data: 'v2'}],
[{text: 'Anleitung', callback_data: 'v3'}],
],
resize_keyboard: true,
parse_mode: 'Markdown'
}),
}
} else {
new_inline_video = {
reply_markup: JSON.stringify({
inline_keyboard: [
[{text: 'Instagram Story', callback_data: 'v1'}],
[{text: 'WhatsApp Videos', callback_data: 'v2'}],
[{text: 'Manuals', callback_data: 'v3'}],
],
resize_keyboard: true,
parse_mode: 'Markdown'
}),
}
}
console.log(new_inline_video);
self.bot.editMessageReplyMarkup(video_chat_id, new_inline_video)
});
Try with this:
var iKeys = [
[{
text: "Btn1",
callback_data: "data1"
}],
[{
text: "Btn2",
callback_data: "data2"
}]
];
bot.editMessageReplyMarkup(video_chat_id, {
parse_mode: 'HTML',
disable_web_page_preview: true,
reply_markup: {
inline_keyboard: iKeys
}
});
PS You should differentiate callback data based on l_key, maybe with v1:german for example, instead you can't distinguish it.
No need of stringifying the object. Closing this issue for now. See the above example which should work.