It's my tg bot for schedule. version 0.1
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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 = {}
|
||||
Reference in New Issue
Block a user