From 9cd9cdc1f424fc32fbf3658274c66ac93c67b51d Mon Sep 17 00:00:00 2001 From: Jason Zavaglia Date: Tue, 2 Feb 2021 21:55:58 +1100 Subject: [PATCH] Just adding some extra detail on how to configure persistence on Dispatcher-only architectures. --- Making-your-bot-persistent.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Making-your-bot-persistent.md b/Making-your-bot-persistent.md index 7e2e734..236efc2 100644 --- a/Making-your-bot-persistent.md +++ b/Making-your-bot-persistent.md @@ -31,6 +31,8 @@ To make your bot persistent you need to do the following. - Create a persistence object (e.g. `my_persistence = PicklePersistence(filename='my_file')`) - Construct Updater with the persistence (`Updater('TOKEN', persistence=my_persistence, use_context=True)`) +Note that the Updater passes the persistence variable to the Dispatcher, so if you aren't using the Updater, you can set the persistence on your Dispatcher object instead. + This is enough to make `user_data`, `bot_data` and `chat_data` persistent. To make a conversation handler persistent (save states between bot restarts) you **must name it** and set `persistent` to `True`. Like `ConversationHandler(, persistent=True, name='my_name')`. `persistent` is `False` by default.