29 lines
827 B
Python
29 lines
827 B
Python
from dataclasses import dataclass
|
|
from typing import Dict, Optional
|
|
from asyncio import Task
|
|
|
|
|
|
@dataclass
|
|
class BotState:
|
|
"""Состояние бота"""
|
|
|
|
last_chat_time: Dict[int, str] = None
|
|
last_pinned: Dict[str, int] = None
|
|
watcher_work: bool = False
|
|
watcher_task: Optional[Task] = None
|
|
file_id_cache: Dict[str, str] = None
|
|
last_day: Dict[str, int] = None
|
|
last_clip_hash: Dict[str, str] = None
|
|
|
|
def __post_init__(self):
|
|
if self.last_chat_time is None:
|
|
self.last_chat_time = {}
|
|
if self.last_pinned is None:
|
|
self.last_pinned = {}
|
|
if self.file_id_cache is None:
|
|
self.file_id_cache = {}
|
|
if self.last_day is None:
|
|
self.last_day = {}
|
|
if self.last_clip_hash is None:
|
|
self.last_clip_hash = {}
|