D
D
Dachnikk2020-04-24 00:28:32
Python
Dachnikk, 2020-04-24 00:28:32

Telegram bot with while?

Help guys with a telegram bot. The meaning of such a bot takes the number of workers from the sender, writes it down, and then the bot must write down the Name and surname of each worker transmitted from the sender by the counter going up to the quantity. I wrote this bot but it does not wait for a message.5ea2087095a1d042050788.jpeg5ea2087b606dc276281853.jpeg

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Krostelev, 2020-04-24
@Dachnikk

You don't have a wait command in your while loop . You just stupidly go around the numbers from 1 to 5 in a cycle and send messages. There is no one more register_next_step_handler
In general, why while and not for ? In your case, the number of workers is known.
You can also prompt the user to enter the names of workers until they run out, without asking in advance their number. The trigger to complete the recording can be any word, such as "stop" or "done".

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question