mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Merge pull request #1575 from coder2020official/bugfixes
Fix bug with unsaving data
This commit is contained in:
commit
a21ab203a1
@ -51,9 +51,11 @@ class StatePickleStorage(StateStorageBase):
|
|||||||
if chat_id in self.data:
|
if chat_id in self.data:
|
||||||
if user_id in self.data[chat_id]:
|
if user_id in self.data[chat_id]:
|
||||||
self.data[chat_id][user_id]['state'] = state
|
self.data[chat_id][user_id]['state'] = state
|
||||||
|
self.update_data()
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.data[chat_id][user_id] = {'state': state, 'data': {}}
|
self.data[chat_id][user_id] = {'state': state, 'data': {}}
|
||||||
|
self.update_data()
|
||||||
return True
|
return True
|
||||||
self.data[chat_id] = {user_id: {'state': state, 'data': {}}}
|
self.data[chat_id] = {user_id: {'state': state, 'data': {}}}
|
||||||
self.update_data()
|
self.update_data()
|
||||||
|
@ -57,9 +57,11 @@ class StatePickleStorage(StateStorageBase):
|
|||||||
if chat_id in self.data:
|
if chat_id in self.data:
|
||||||
if user_id in self.data[chat_id]:
|
if user_id in self.data[chat_id]:
|
||||||
self.data[chat_id][user_id]['state'] = state
|
self.data[chat_id][user_id]['state'] = state
|
||||||
|
self.update_data()
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
self.data[chat_id][user_id] = {'state': state, 'data': {}}
|
self.data[chat_id][user_id] = {'state': state, 'data': {}}
|
||||||
|
self.update_data()
|
||||||
return True
|
return True
|
||||||
self.data[chat_id] = {user_id: {'state': state, 'data': {}}}
|
self.data[chat_id] = {user_id: {'state': state, 'data': {}}}
|
||||||
self.update_data()
|
self.update_data()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user