2024-10-31 17:58:55 +00:00
|
|
|
import dataclasses
|
|
|
|
import datetime
|
|
|
|
|
2024-10-31 19:36:38 +00:00
|
|
|
MYSELF = 'MYSELF'
|
|
|
|
|
|
|
|
|
2024-10-31 17:58:55 +00:00
|
|
|
@dataclasses.dataclass(frozen=True, order=True)
|
|
|
|
class Message:
|
|
|
|
sent_at: datetime.datetime
|
|
|
|
sender: str
|
|
|
|
text: str
|
2024-10-31 19:36:38 +00:00
|
|
|
chat_id: str
|
2024-10-31 17:58:55 +00:00
|
|
|
|
|
|
|
def __post_init__(self):
|
|
|
|
assert self.sent_at is not None
|
|
|
|
assert self.sender is not None
|
|
|
|
assert self.text is not None
|
2024-10-31 19:36:38 +00:00
|
|
|
assert self.chat_id is not None
|