|
@@ -5,6 +5,7 @@ from dataclasses import dataclass, field
|
|
|
from datetime import datetime
|
|
|
from collections.abc import Callable, Coroutine, Container
|
|
|
from typing import Union, Any, Optional
|
|
|
+import time
|
|
|
|
|
|
from aiosqlite import Connection
|
|
|
from aiohttp import ClientSession
|
|
@@ -39,6 +40,7 @@ class Message:
|
|
|
text: Optional[str] = None
|
|
|
attachments: list[Attachment] = field(default_factory=list)
|
|
|
message_id: Optional[str] = None
|
|
|
+ received_at: float = field(default_factory=time.time)
|
|
|
|
|
|
def __post_init__(self):
|
|
|
self.command = None
|
|
@@ -90,6 +92,7 @@ class Response:
|
|
|
channel_id: str
|
|
|
text: Optional[str] = None
|
|
|
attachments: Optional[list[Attachment]] = None
|
|
|
+ cause: Optional[Message] = None
|
|
|
|
|
|
@staticmethod
|
|
|
def from_message(
|
|
@@ -100,6 +103,7 @@ class Response:
|
|
|
channel_id=msg.channel_id,
|
|
|
text=text,
|
|
|
attachments=attachments or [],
|
|
|
+ cause=msg,
|
|
|
)
|
|
|
|
|
|
|