diff --git a/maubot/handlers/command.py b/maubot/handlers/command.py index 4d0058f..bee5509 100644 --- a/maubot/handlers/command.py +++ b/maubot/handlers/command.py @@ -26,8 +26,9 @@ from mautrix.types import MessageType, EventType from ..matrix import MaubotMessageEvent from . import event -PrefixType = Optional[Union[str, Callable[[], str]]] -AliasesType = Union[List[str], Tuple[str, ...], Set[str], Callable[[str], bool]] +PrefixType = Optional[Union[str, Callable[[], str], Callable[[Any], str]]] +AliasesType = Union[List[str], Tuple[str, ...], Set[str], Callable[[str], bool], + Callable[[Any, str], bool]] CommandHandlerFunc = NewType("CommandHandlerFunc", Callable[[MaubotMessageEvent, Any], Awaitable[Any]]) CommandHandlerDecorator = NewType("CommandHandlerDecorator", diff --git a/maubot/plugin_base.py b/maubot/plugin_base.py index b2608c8..034ccef 100644 --- a/maubot/plugin_base.py +++ b/maubot/plugin_base.py @@ -30,6 +30,7 @@ if TYPE_CHECKING: class Plugin(ABC): client: 'MaubotMatrixClient' + http: ClientSession id: str log: Logger loop: AbstractEventLoop