A
A
Anonymous Coder2020-12-05 15:23:46
Bots
Anonymous Coder, 2020-12-05 15:23:46

How to find the username of the user who clicked on the callback button if the button is displayed in a group?

The bot displays a message with an inline button in the group. When the button is clicked, the button should disappear and the username of the person who clicked the button should appear.
If I get just call.message.chat.id or call.message.from_user.id, either the username of the bot or the group is read, but the user who did not click on the button.

Who knows how to solve the problem?

Python, pyTelegramBotApi

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alex K, 2020-12-05
@Geza420

message is the original message object in which the button hangs. Try `call.from.id`.
Upd: `call.from.id` is the user id. For username - `call.from.username`

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question