defstudio / telegraph

Telegraph is a Laravel package for fluently interacting with Telegram Bots
MIT License
674 stars 116 forks source link

How to get a user who pressed a button? #623

Closed AnFox closed 1 month ago

AnFox commented 1 month ago

My bot replies to a message with his answer and a button with some action on it. There are several users in the chat, and I wonder how I get the user who pressed this button in the action method.

fabio-ivona commented 1 month ago

You can retrieve user information from the $callbackQuery property in your Webhook Handler

then I think you can store the telegram user ID in your application user model