|
@@ -2,6 +2,7 @@ from dataclasses import dataclass, field
|
|
|
from datetime import datetime
|
|
|
from collections.abc import Callable, Coroutine, Container
|
|
|
from typing import Union, Any, Optional
|
|
|
+from __future__ import annotations
|
|
|
|
|
|
from aiosqlite.core import Connection
|
|
|
|
|
@@ -34,7 +35,7 @@ class Command:
|
|
|
args: str
|
|
|
|
|
|
@staticmethod
|
|
|
- def from_text(text: str) -> Optional["Command"]:
|
|
|
+ def from_text(text: str) -> Optional[Command]:
|
|
|
cleaned = text.lstrip()
|
|
|
|
|
|
if len(cleaned) < 2:
|
|
@@ -61,7 +62,7 @@ class Response:
|
|
|
@staticmethod
|
|
|
def from_message(
|
|
|
msg: Message, text: Optional[str] = None, attachments: list[Attachment] = None
|
|
|
- ) -> "Response":
|
|
|
+ ) -> Response:
|
|
|
return Response(
|
|
|
origin_id=msg.origin_id,
|
|
|
channel_id=msg.channel_id,
|
|
@@ -90,7 +91,7 @@ class CommandConfiguration:
|
|
|
startup: list[StartupShutdownType] = field(default_factory=list)
|
|
|
shutdown: list[StartupShutdownType] = field(default_factory=list)
|
|
|
|
|
|
- def extend(self, other: "CommandConfiguration") -> "CommandConfiguration":
|
|
|
+ def extend(self, other: CommandConfiguration) -> CommandConfiguration:
|
|
|
return CommandConfiguration(
|
|
|
commands={
|
|
|
**self.commands,
|