From 3a6073e3a0bcf9779eeab53a69aa49baf5de7392 Mon Sep 17 00:00:00 2001 From: _run Date: Sat, 6 Nov 2021 13:08:49 +0500 Subject: [PATCH] Update custom_states.py --- examples/custom_states.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/custom_states.py b/examples/custom_states.py index 22691b2..5acc8f2 100644 --- a/examples/custom_states.py +++ b/examples/custom_states.py @@ -17,7 +17,7 @@ def start_ex(message): """ Start command. Here we are starting state """ - bot.set_state(message.from_user.id, 1) + bot.set_state(message.from_user.id, MyStates.name) bot.send_message(message.chat.id, 'Hi, write me a name') @@ -36,7 +36,7 @@ def name_get(message): State 1. Will process when user's state is 1. """ bot.send_message(message.chat.id, f'Now write me a surname') - bot.set_state(message.from_user.id, 2) + bot.set_state(message.from_user.id, MyStates.surname) with bot.retrieve_data(message.from_user.id) as data: data['name'] = message.text @@ -47,7 +47,7 @@ def ask_age(message): State 2. Will process when user's state is 2. """ bot.send_message(message.chat.id, "What is your age?") - bot.set_state(message.from_user.id, 3) + bot.set_state(message.from_user.id, MyStates.age) with bot.retrieve_data(message.from_user.id) as data: data['surname'] = message.text