MCPcopy Index your code
hub / github.com/nonebot/nonebot2 / on_notice

Method on_notice

nonebot/plugin/on.py:606–622  ·  view source on GitHub ↗

注册一个通知事件响应器。 参数: rule: 事件响应规则 permission: 事件响应权限 handlers: 事件处理函数列表 temp: 是否为临时事件响应器(仅执行一次) expire_time: 事件响应器最终有效时间点,过时即被删除 priority: 事件响应器优先级 block: 是否阻止事件向更低优先级传递 state: 默认 state

(self, **kwargs)

Source from the content-addressed store, hash-verified

604 return matcher
605
606 def on_notice(self, **kwargs) -> type[Matcher]:
607 """注册一个通知事件响应器。
608
609 参数:
610 rule: 事件响应规则
611 permission: 事件响应权限
612 handlers: 事件处理函数列表
613 temp: 是否为临时事件响应器(仅执行一次)
614 expire_time: 事件响应器最终有效时间点,过时即被删除
615 priority: 事件响应器优先级
616 block: 是否阻止事件向更低优先级传递
617 state: 默认 state
618 """
619 final_kwargs = self._get_final_kwargs(kwargs, exclude={"type", "permission"})
620 matcher = on_notice(**final_kwargs)
621 self.matchers.append(matcher)
622 return matcher
623
624 def on_request(self, **kwargs) -> type[Matcher]:
625 """注册一个请求事件响应器。

Callers 1

matchers.pyFile · 0.80

Calls 3

on_noticeFunction · 0.85
_get_final_kwargsMethod · 0.80
appendMethod · 0.80

Tested by

no test coverage detected