I have an array of messages containing some text and an inline keyboard with "delete" button.
bot.command('items', ctx => {
items.forEach(async data => {
await ctx.reply(data.Title,
Markup.inlineKeyboard([Markup.button.callback("delete item", "DeleteItem")]));
})
})
And I have a function bot.action for the delete buttons on my inline keyboard. How do I pass a parameter to the bot.action so I can delete the item via the delete button.
bot.action("DeleteItem", async ctx => {
ctx.reply("deleting item");
})
For delete message, you can use:
As you can see from examples/echo-bot-module.js.
If you need pass a parameter to the
bot.action
, you may try: