From 57938f7762fae96edcabe3399beffa5c8c233b80 Mon Sep 17 00:00:00 2001 From: thebocher <63579888+thebocher@users.noreply.github.com> Date: Thu, 10 Oct 2024 15:24:58 +0200 Subject: [PATCH] Update pickle_storage.py fixed typo in StatePickleStorage.save, which didn't allow to save user state, but instead copied the whole content of state file inside "data" --- telebot/storage/pickle_storage.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/telebot/storage/pickle_storage.py b/telebot/storage/pickle_storage.py index e11a05043..b4c44e8fa 100644 --- a/telebot/storage/pickle_storage.py +++ b/telebot/storage/pickle_storage.py @@ -254,9 +254,9 @@ def save( message_thread_id, bot_id, ) - data = self._read_from_file() - data[_key]["data"] = data - self._write_to_file(data) + file_data = self._read_from_file() + file_data[_key]["data"] = data + self._write_to_file(file_data) return True def __str__(self) -> str: