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

Compare commits

...

2 Commits

Author SHA1 Message Date
Badiboy
a21ab203a1
Merge pull request #1575 from coder2020official/bugfixes
Fix bug with unsaving data
2022-06-04 19:44:47 +03:00
coder2020official
e689e968db Fix bug with unsaving data 2022-06-04 21:33:05 +05:00
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()