How to make a Python telegram bot wait for user input?

13.2k views Asked by At

Example: I send /weather to a bot and he asked me city. How to make him wait to reply?

2

There are 2 answers

0
dnth On

You can use the InlineKeyboardButton for that. It pops up a button for the user to press on. You can 'wait' for the user to input the data that way

0
mhcpan On

ConversationHandler can be used to achieve the purpose. Python-telegram-bot conversationbot2.py example gives a good reference.