|
@@ -1,5 +1,5 @@
|
|
|
from collections.abc import Callable, Coroutine
|
|
|
-from typing import TypeVar, Any
|
|
|
+from typing import TypeVar, Any, Optional
|
|
|
from datetime import datetime
|
|
|
from logging import Logger
|
|
|
|
|
@@ -17,12 +17,14 @@ __all__ = [
|
|
|
"Timestamp",
|
|
|
"OriginAdmin",
|
|
|
"ChannelAdmin",
|
|
|
+ "SenderName",
|
|
|
"Text",
|
|
|
"Attachments",
|
|
|
"CommandInjector",
|
|
|
"Request",
|
|
|
"Respond",
|
|
|
"LoggerInjector",
|
|
|
+ "Debugging",
|
|
|
"Config",
|
|
|
"Lazy",
|
|
|
]
|
|
@@ -35,12 +37,14 @@ Sender = Simple[str](lambda m, c: m.sender_id)
|
|
|
Timestamp = Simple[datetime](lambda m, c: m.timestamp)
|
|
|
OriginAdmin = Simple[bool](lambda m, c: m.origin_admin)
|
|
|
ChannelAdmin = Simple[bool](lambda m, c: m.channel_admin)
|
|
|
+SenderName = Simple[Optional[str]](lambda m, c: m.sender_name)
|
|
|
Text = Simple[str](lambda m, c: m.text)
|
|
|
Attachments = Simple[list[Attachment]](lambda m, c: m.attachments)
|
|
|
CommandInjector = Simple[Command](lambda m, c: m.command)
|
|
|
Request = Simple[ClientSession](lambda m, c: c.request)
|
|
|
Respond = Simple[Callable[[], Coroutine[None, None, None]]](lambda m, c: c.respond)
|
|
|
LoggerInjector = Simple[Logger](lambda m, c: c.logger)
|
|
|
+Debugging = Simple[Optional[str]](lambda m, c: c.get_debugging())
|
|
|
|
|
|
|
|
|
class Config(Injector[Any]):
|