C
C
carbone2022-04-14 00:06:36
Telegram
carbone, 2022-04-14 00:06:36

Telebot python how to make input function?

How can the input function be implemented? more specifically, I need to get a number from the user from 1 to 86, if the number is less than 1 or more than 86, then the user will be prompted to enter the number again

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Daniil Dedinets, 2022-04-14
@donko1

@bot.message_handler(content_types=['text'])
def func1(message):
 bot.send_message(message.from_user.id, 'Введите текст')
 bot.register_next_step_handler(message, func2)

def func2(message):
 var = message.text # Текст сообщения от пользователя
 bot.send_message(message.from_user.id, var) # Вернет сообщение пользователя обартно

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question