Skip to content
This repository was archived by the owner on Feb 7, 2025. It is now read-only.

Is the callbackQuery no't working ? #199

Open
xMA3x opened this issue Apr 19, 2021 · 2 comments
Open

Is the callbackQuery no't working ? #199

xMA3x opened this issue Apr 19, 2021 · 2 comments

Comments

@xMA3x
Copy link

xMA3x commented Apr 19, 2021

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

@ncovercash
Copy link

The answerCallbackQuery function has changed. Try:

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

instead

@froller
Copy link

froller commented May 5, 2023

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants