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

Function store_matcher

nonebot/plugin/on.py:40–48  ·  view source on GitHub ↗

存储一个事件响应器到插件。 参数: matcher: 事件响应器

(matcher: type[Matcher])

Source from the content-addressed store, hash-verified

38
39
40def store_matcher(matcher: type[Matcher]) -> None:
41 """存储一个事件响应器到插件。
42
43 参数:
44 matcher: 事件响应器
45 """
46 # only store the matcher defined when plugin loading
47 if plugin := _current_plugin.get():
48 plugin.matcher.add(matcher)
49
50
51def get_matcher_plugin(depth: int = 1) -> Plugin | None: # pragma: no cover

Callers 1

onFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected