Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
Use register_next_step_handler, passing the necessary variables to it
import telebot
from telebot import types
@bot.message_handler(commands=['start'])
def main(message):
msg = bot.send_message(message.chat.id, 'Введите ФИО')
bot.register_next_step_handler(msg, fio_step)
def fio_step(message):
user_info = {}
user_info['name'] = message.text
msg = bot.send_message(message.chat.id, 'Введите возраст')
bot.register_next_step_handler(msg, age_step, user_info)
def age_step(message, user_info):
user_info['age'] = message.text
print(user_info)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question