Closed tinsaeDev closed 2 years ago
Hi, @tinsaeDev you need to do JSON.stringify of the menu_button object
@danielperez9430 hi! I'm trying to set my menu button like this
bot.setChatMenuButton(
JSON.stringify({
chat_id: msg.chat.id,
menu_button: {
text: 'Order food',
type: 'commands',
},
}),
);
and it's not working. I had registered the list of commands with the help of BotFather
bot.setChatMenuButton( JSON.stringify({ chat_id: msg.chat.id, menu_button: { text: 'Order food', type: 'commands', }, }), );
bot.setChatMenuButton( { chat_id: msg.chat.id, menu_button: JSON.stringify( { text: 'Order food', type: 'commands', }, }), );
bot.setChatMenuButton( JSON.stringify({ chat_id: msg.chat.id, menu_button: { texto: 'Pedir comida', tipo: 'comandos', }, }), );
bot.setChatMenuButton( { chat_id: msg.chat.id, menu_button: JSON.stringify( { text: 'Order food', type: 'commands', }, }), );
Hola, recien agrego, no muestra error alguno pero tampoco el boton. Saludos.
I have read:
I am using the latest version of the library.
Expected Behavior
the setChatMenuButton shall set chat's menu button programatically.
Actual Behavior
Instead it is just removing existing menu buttons.
Steps to reproduce the Behavior
The above code shall set menu button for the specified chatId
I have:
Introduction
I am building a bot webapp that needs to have a chat bot menu set dynamically
Example