存储一个事件响应器到插件。 参数: matcher: 事件响应器
(matcher: type[Matcher])
| 38 | |
| 39 | |
| 40 | def 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 | |
| 51 | def get_matcher_plugin(depth: int = 1) -> Plugin | None: # pragma: no cover |