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

Function on_request

nonebot/plugin/on.py:205–218  ·  view source on GitHub ↗

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

(*args, _depth: int = 0, **kwargs)

Source from the content-addressed store, hash-verified

203
204
205def on_request(*args, _depth: int = 0, **kwargs) -> type[Matcher]:
206 """注册一个请求事件响应器。
207
208 参数:
209 rule: 事件响应规则
210 permission: 事件响应权限
211 handlers: 事件处理函数列表
212 temp: 是否为临时事件响应器(仅执行一次)
213 expire_time: 事件响应器最终有效时间点,过时即被删除
214 priority: 事件响应器优先级
215 block: 是否阻止事件向更低优先级传递
216 state: 默认 state
217 """
218 return on("request", *args, **kwargs, _depth=_depth + 1)
219
220
221def on_startswith(

Callers 2

matchers.pyFile · 0.90
on_requestMethod · 0.85

Calls 1

onFunction · 0.85

Tested by

no test coverage detected