eternnoir / pyTelegramBotAPI

Python Telegram bot api.
GNU General Public License v2.0
8.11k stars 2.03k forks source link

Get user data from bot #281

Closed MarcSky closed 7 years ago

MarcSky commented 7 years ago

Please answer these questions before submitting your issue. Thanks!

  1. What version of pyTelegramBotAPI are you using? 2.3.0

  2. What OS are you using? macos

  3. What version of python are you using? 3.5

I have a inline buttons, pressing on them I want to receive information from the user, such as age or height. How to do it? Where can I read the text data from the user? How to determine which inline button refers answer?

MonsterDeveloper commented 7 years ago

For usual message it is easy - just use register_next_step_handler. But for callback buttons... It's more tricky. Tomorrow I will try to write example code for you.

MonsterDeveloper commented 7 years ago

Do you need to check this data? If its not, you can just write data in MongoDB of txt file

MonsterDeveloper commented 7 years ago

You can use force reply. Send it, check reply message text when user answers and write data