diff --git a/examples/step_example.py b/examples/step_example.py index fd8d07d..0fc0ef1 100644 --- a/examples/step_example.py +++ b/examples/step_example.py @@ -75,4 +75,14 @@ def process_sex_step(message): bot.reply_to(message, 'oooops') +# Enable saving next step handlers to file "./.handlers-saves/step.save". +# Delay=2 means that after any change in next step handlers (e.g. calling register_next_step_handler()) +# saving will hapen after delay 2 seconds. +bot.enable_save_next_step_handlers(delay=2) + +# Load next_step_handlers from save file (default "./.handlers-saves/step.save") +# WARNING It will work only if enable_save_next_step_handlers was called! +bot.load_next_step_handlers() + + bot.polling()