INNER CODE UNIT · Python
check_state
sidor0912/FunPayCardinal · tg_bot/bot.py:156
def check_state(self, chat_id: int, user_id: int, state: str) -> bool:
"""
Проверяет, является ли состояние указанным.
:param chat_id: id чата.
:param user_id: id пользователя.
:param state: состояние.
:return: True / False
"""
try:
return self.user_states[chat_id][user_id]["state"] == state
except KeyError:
return False
# Notification settings
def is_notification_enabled(self, chat_id: int | str, notification_type: str) -> bool:
"""