make matcher running concurrently and add to me checking

This commit is contained in:
yanyongyu
2020-08-21 14:24:32 +08:00
parent c01d3c7ca1
commit c1d0eae34b
6 changed files with 220 additions and 42 deletions

View File

@ -51,7 +51,16 @@ class BaseEvent(abc.ABC):
def __repr__(self) -> str:
# TODO: pretty print
return f"<Event: >"
return f"<Event: {self.type}/{self.detail_type} {self.raw_message}>"
@property
def raw_event(self) -> dict:
return self._raw_event
@property
@abc.abstractmethod
def self_id(self) -> str:
raise NotImplementedError
@property
@abc.abstractmethod
@ -93,6 +102,16 @@ class BaseEvent(abc.ABC):
def user_id(self, value) -> None:
raise NotImplementedError
@property
@abc.abstractmethod
def to_me(self) -> Optional[bool]:
raise NotImplementedError
@to_me.setter
@abc.abstractmethod
def to_me(self, value) -> None:
raise NotImplementedError
@property
@abc.abstractmethod
def message(self) -> Optional[Message]: