G
G
GordeyMan2017-10-13 11:58:24
Python
GordeyMan, 2017-10-13 11:58:24

Questionnaire TelegramBot?

Good day.
Now I'm dealing with Telegram Bot, and I have a question. What is the best way to implement a user survey. That is, I need to request: last name, account number, district, etc.
The bot is written in python. I will be grateful for any help.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Trakhimenok, 2017-10-13
@GordeyMan

You need to create an entry in the database with a key by the chat number and store the state of the bot in it. For example, what question is expected to be answered at the current moment.
Then implement a state machine that will change the state.
You can see how it works in my debt tracking bot https://t.me/DebtsTrackerRuBot - developed on the Go framework https://GitHub.com/strongo/bots-framework

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question