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

Avoid circular import

This commit is contained in:
coder2020official
2022-05-02 14:45:43 +05:00
parent 836130a718
commit f9cd0d7e08
6 changed files with 6 additions and 13 deletions

View File

@ -1,7 +1,5 @@
from telebot.asyncio_storage.base_storage import StateStorageBase, StateContext
from telebot.asyncio_handler_backends import State
class StateMemoryStorage(StateStorageBase):
def __init__(self) -> None:
self.data = {}
@ -10,7 +8,7 @@ class StateMemoryStorage(StateStorageBase):
async def set_state(self, chat_id, user_id, state):
if isinstance(state, State):
if hasattr(state, 'name'):
state = state.name
if chat_id in self.data:
if user_id in self.data[chat_id]: