telebot
telebot copied to clipboard
Is the callbackQuery no't working ?
trafficstars
so i keep trying testing the Inline button callback but all is in vain i tyred the keyboard.js example and didn't work to
idk what i have to do to make it work! anyway, that is the cod that i used
// Inline buttons
bot.on('/Method', msg => {
let replyMarkup = bot.inlineKeyboard([
[
bot.inlineButton('callbackQuery', {callback: 'callbackQuery'}),
bot.inlineButton('inline', {inline: 'some query'})
], [
bot.inlineButton('url', {url: 'https://telegram.org'})
]
]);
return bot.sendMessage(msg.from.id, 'Inline keyboard example.', {replyMarkup});
});
// Inline button callback
bot.on('callbackQuery', msg => {
// User message alert
return bot.answerCallbackQuery(msg.id, `Inline button callback: ${ msg.data }`, true);
});
when i click on callback it just load for ever
The answerCallbackQuery function has changed. Try:
return telegramBot.answerCallbackQuery(msg.id, {text: `Inline button callback: ${ msg.data }`});
instead
Doesn't work either... just does nothing.