MCPcopy
hub / github.com/nonebot/nonebot2 / ToMeRule

Class ToMeRule

nonebot/rule.py:720–735  ·  view source on GitHub ↗

检查事件是否与机器人有关。

Source from the content-addressed store, hash-verified

718
719
720class 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
738def to_me() -> Rule:

Callers 1

to_meFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected