Answer the question
In order to leave comments, you need to log in
How to implement an infinite loop for a bot telebot module?
import telebot
bot = telebot.TeleBot('TOKEN')
@bot.message_handler(commands=['start'])
def start(message):
while True:
msg = bot.send_message(message.chat.id,'enter data: ')
bot.register_next_step_handler(msg,foo)
def foo(message):
data = message.text
# and something else ...
# and while this is happening, the loop should pause as input waits until you enter data
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