mirror of
https://github.com/eternnoir/pyTelegramBotAPI.git
synced 2023-08-10 21:12:57 +03:00
Code base cleanup
This commit is contained in:
@ -42,7 +42,7 @@ class StateStorageBase:
|
||||
def get_state(self, chat_id, user_id):
|
||||
raise NotImplementedError
|
||||
|
||||
def save(chat_id, user_id, data):
|
||||
def save(self, chat_id, user_id, data):
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
|
@ -6,6 +6,7 @@ import pickle
|
||||
|
||||
|
||||
class StatePickleStorage(StateStorageBase):
|
||||
# noinspection PyMissingConstructor
|
||||
def __init__(self, file_path="./.state-save/states.pkl") -> None:
|
||||
self.file_path = file_path
|
||||
self.create_dir()
|
||||
@ -109,4 +110,4 @@ class StatePickleStorage(StateStorageBase):
|
||||
|
||||
def save(self, chat_id, user_id, data):
|
||||
self.data[chat_id][user_id]['data'] = data
|
||||
self.update_data()
|
||||
self.update_data()
|
||||
|
Reference in New Issue
Block a user