telebot icon indicating copy to clipboard operation
telebot copied to clipboard

Is the callbackQuery no't working ?

Open xMA3x opened this issue 4 years ago • 2 comments
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

xMA3x avatar Apr 19 '21 09:04 xMA3x

The answerCallbackQuery function has changed. Try:

return telegramBot.answerCallbackQuery(msg.id, {text: `Inline button callback: ${ msg.data }`});

instead

ncovercash avatar Apr 26 '21 05:04 ncovercash

Doesn't work either... just does nothing.

froller avatar May 05 '23 09:05 froller