Code
Hub
Workspaces
Connect
Indexed graphs
Engine
MCP
copy
hub
/
github.com/nonebot/nonebot2
/ is_type
Function
is_type
nonebot/rule.py:765–772 ·
view source on GitHub ↗
匹配事件类型。 参数: types: 事件类型
(*types: type[Event])
Source
from the content-addressed store, hash-verified
763
764
765
def
is_type(*types: type[Event]) -> Rule:
766
""
"匹配事件类型。
767
768
参数:
769
types: 事件类型
770
""
"
771
772
return
Rule(IsTypeRule(*types))
773
774
775
__autodoc__ = {
Callers
2
on_type
Function · 0.90
test_is_type
Function · 0.90
Calls
2
Rule
Class · 0.90
IsTypeRule
Class · 0.85
Tested by
1
test_is_type
Function · 0.72