From 13df7b59081411bd7f9e5ce05ee9357e35e4845c Mon Sep 17 00:00:00 2001 From: Waffle Date: Sat, 26 May 2018 17:21:39 +0300 Subject: [PATCH] Add enable_save_next_step_handlers and load_next_step_handlers methods to step_example/ Update: examples/step_example.py --- examples/step_example.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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()