获取事件响应器定义所在模块。 **Deprecated**, 请使用 {ref}`nonebot.plugin.on.get_matcher_source` 获取信息。 参数: depth: 调用栈深度
(depth: int = 1)
| 64 | |
| 65 | |
| 66 | def 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 | |
| 81 | def get_matcher_source(depth: int = 0) -> MatcherSource | None: |
nothing calls this directly
no test coverage detected