Closed edakhmetgareev closed 8 years ago
@aed86 just save somewhere 2nd parameter of callback query response
callback: (cb, msg) => {
$.api.answerCallbackQuery(cb.id);
$.userSesion.msg = msg; // or kind of it
const otherMenu = {
method: 'sendMessage',
params: [msg], // hello there
message: 'My new message',
menu: [ /* ... */ ]
};
$.runInlineMenu(menu, msg);
}
@aed86
Hi! @VitaliyR right, but you can also use submenus from docs: https://github.com/Naltox/telegram-node-bot#inline-menu
Hello, I am using 'extension-telegram-node-bot', now problem is
{ text: 'telegram', url: 'telegram.org', callback: (callbackQuery, message) => { console.log('Buy') } }
url doesn't work
My use case is I don't want to create a new menu, I want to update the old one, just like is used in this bot
Hello,
Maybe I use this method do not correctly, but I think it should be refactored. If I use readme example for send inline keyboard, then it work ok only for
sendMessage
$.runInlineMenu({ layout: 2 method: 'sendMessage' params: ['text'] menu: [...] });
If I want to edit inline menu message, then I should send aprevMessage
as second parameter. In this case I have an error in Scope.js on 408 line:params[0].chat_id = prevMessage.chat.id
params[0].message_id = prevMessage.messageId
because params[0] is not an object, it is a string (params: ['text']). Therefore I have to do next trick:$.runInlineMenu({layout: 1, method: 'sendMessage', menu: menu,
message: 'Text',
// Pass additional param instead of `params: [text]params: prevMessage == undefined ? ['Text'] : [],
// Skip this line for bypass Scope.js error on 408 line}, prevMessage)
If I am wrong, could you explain me how use correctly this method for sending and editing inline keyboard message?
Thank you.