Answer the question
In order to leave comments, you need to log in
How can I make the telegram bot constantly ask and record the user's response?
It is necessary that after the user enters the command, the bot asks a question and accepts an answer from the user, and so on endlessly until the user writes, for example, cancel, he only thought of this, but of course this does not work:
import telebot
bot = telebot.TeleBot('')
@bot.message_handler(content_types=['text'])
def send_text(m):
if m.text.lower() == 'время':
global otvet
otvet = []
while True:
bot.send_message(m.chat.id, 'давай')
bot.register_next_step_handler(m,ggh)
def ggh(m):
g = str(m.text)
otvet.append(g)
bot.polling()
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question