检查事件是否与机器人有关。
| 718 | |
| 719 | |
| 720 | class ToMeRule: |
| 721 | """检查事件是否与机器人有关。""" |
| 722 | |
| 723 | __slots__ = () |
| 724 | |
| 725 | def __repr__(self) -> str: |
| 726 | return "ToMe()" |
| 727 | |
| 728 | def __eq__(self, other: object) -> bool: |
| 729 | return isinstance(other, ToMeRule) |
| 730 | |
| 731 | def __hash__(self) -> int: |
| 732 | return hash((self.__class__,)) |
| 733 | |
| 734 | async def __call__(self, to_me: bool = EventToMe()) -> bool: |
| 735 | return to_me |
| 736 | |
| 737 | |
| 738 | def to_me() -> Rule: |