I just started using Telegraf to make a Telegram bot with node, and the bot uses an inline keyboard for users to select from a given option. But after the user selects one option and gets a response, the user can still click on the other options and get their response.
ctx.reply("Do you want to order the product?", {
parse_mode: "HTML",
...Markup.inlineKeyboard([
Markup.button.callback("Order", "order"),
Markup.button.callback("Cancel", "cancel"),
]),
});
I tried to disable it using bot.hears method
bot.hears("order", (ctx) => {
"removed",
{
reply_markup: {
remove_keyboard: true,
},
};
});
bot.hears("cancel", (ctx) => {
"removed",
{
reply_markup: {
remove_keyboard: true,
},
};
});
but the methods don't seem to disable/ remove the options. So is there a way to disable the inline keyboards after one click