Hi everyone I'm sorry to bother you again, but I'm

struggling with inline keyboards (=buttons)

First of all, I'm working with PHP
I made the inline keyboards, users can call it whenever they want but I don't know how to handle callback queries properly.
Online i found some stuff but it didn't help so much.
Can anyone tell me how I can take the information that a button is pressed (and which one)?

8 ответов

11 просмотров

you need to put callback_data inside your buttons

Ugo Pesce - Cum Monster
I did it

so that's how you know which button was pressed, by reading the callback_data

Ugo Pesce-- Cum Monster Автор вопроса
dotvhs
so that's how you know which button was pressed, b...

But I have to take another id because the user isn't sending a message, am I right?

Ugo Pesce-- Cum Monster Автор вопроса
dotvhs
id of what?

Of the user but with the callbackquery[from] (?)

Ugo Pesce - Cum Monster
Of the user but with the callbackquery[from] (?)

you can read who pressed and what was pressed from callbackquery, yeah, there will be userid and inside callback_data you will see what was pressed

Ugo Pesce-- Cum Monster Автор вопроса
dotvhs
you can read who pressed and what was pressed from...

Exactly, but my struggle is here: I still don't understand what callbackquery exactly is and how his fields work

Похожие вопросы

Карта сайта