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

Function get_matcher_module

nonebot/plugin/on.py:66–78  ·  view source on GitHub ↗

获取事件响应器定义所在模块。 **Deprecated**, 请使用 {ref}`nonebot.plugin.on.get_matcher_source` 获取信息。 参数: depth: 调用栈深度

(depth: int = 1)

Source from the content-addressed store, hash-verified

64
65
66def get_matcher_module(depth: int = 1) -> ModuleType | None: # pragma: no cover
67 """获取事件响应器定义所在模块。
68
69 **Deprecated**, 请使用 {ref}`nonebot.plugin.on.get_matcher_source` 获取信息。
70
71 参数:
72 depth: 调用栈深度
73 """
74 warnings.warn(
75 "`get_matcher_module` is deprecated, please use `get_matcher_source` instead",
76 DeprecationWarning,
77 )
78 return (source := get_matcher_source(depth + 1)) and source.module
79
80
81def get_matcher_source(depth: int = 0) -> MatcherSource | None:

Callers

nothing calls this directly

Calls 1

get_matcher_sourceFunction · 0.85

Tested by

no test coverage detected