1
0
mirror of https://github.com/eternnoir/pyTelegramBotAPI.git synced 2023-08-10 21:12:57 +03:00

Fix bug with unsaving data

This commit is contained in:
coder2020official 2022-06-04 21:33:05 +05:00
parent 8da749ee05
commit e689e968db
2 changed files with 4 additions and 0 deletions

View File

@ -51,9 +51,11 @@ class StatePickleStorage(StateStorageBase):
if chat_id in self.data:
if user_id in self.data[chat_id]:
self.data[chat_id][user_id]['state'] = state
self.update_data()
return True
else:
self.data[chat_id][user_id] = {'state': state, 'data': {}}
self.update_data()
return True
self.data[chat_id] = {user_id: {'state': state, 'data': {}}}
self.update_data()

View File

@ -57,9 +57,11 @@ class StatePickleStorage(StateStorageBase):
if chat_id in self.data:
if user_id in self.data[chat_id]:
self.data[chat_id][user_id]['state'] = state
self.update_data()
return True
else:
self.data[chat_id][user_id] = {'state': state, 'data': {}}
self.update_data()
return True
self.data[chat_id] = {user_id: {'state': state, 'data': {}}}
self.update_data()