Closed maslopop closed 4 years ago
The idea of inline buttons below a message is to stick to their context in the chat history. So basically not jumping around. I see it being useful but the current approach of the library wasn't built with that in mind.
Maybe the screenshot in your case is relevant for the current menu? Then maybe setting it as photo might be useful. Check the Readme for more details about how to use it. Its also in the example if you want to see it in action.
const menu = new TelegrafInlineMenu('Awesome text', {
photo: currentAwesomeScreenshot())
}
Wow, I always discover new things on this library. I didn't explain myself well, and for this I apologize for my poor English ... I would need replyWithphoto not to make the menu go above the photo, I would like to be able to position it again down in the chat ... in the bottom it is possible in some way ?
Thank you very much
Massimo
The library wasnt built with an idea like that in mind. Thats why I suggested something different which might also work. ;)
Maybe something using replyMenuMiddleware.setSpecific combined with ctx.delete might work.
const menu = new TelegrafInlineMenu(…)
const replyMenuMiddleware = menu.replyMenuMiddleware()
menu.simpleButton(…, …, {
doFunc: async ctx => {
await replyMenuMiddleware.setSpecfic(ctx, 'actionCode')
await ctx.deleteMessage()
}
})
Hope it helps :)
Yes i like it ...
fedeltà.submenu(carta_fidelity_foto, 'bcar2', new TelegrafInlineMenu('', { photo: (ctx) => { var card = dati_fid(ctx).fidelity var fcart = path.resolve(__dirname + it.pathcarte, card + '.png') if ((fs.existsSync(fcart))) { return { source: fs.readFileSync(fcart), filename: 'fidelity card ' + card } } } , hide: (ctx) => { return (dati_fid(ctx).fidelity == '') } }))
Ciao, I have a need that is important to me; it happens that the bot replies the user with a message or an image as in the case of the screenshoot, I would like to redesign the menu after the message so that it appears again at the bottom and does not go up in the chat, as happens when a user answers a question.
I thank you for your quick answers .. Massimo