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

Function event_preprocessor

nonebot/message.py:92–100  ·  view source on GitHub ↗

事件预处理。 装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。

(func: T_EventPreProcessor)

Source from the content-addressed store, hash-verified

90
91
92def event_preprocessor(func: T_EventPreProcessor) -> T_EventPreProcessor:
93 """事件预处理。
94
95 装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。
96 """
97 _event_preprocessors.add(
98 Dependent[Any].parse(call=func, allow_types=EVENT_PCS_PARAMS)
99 )
100 return func
101
102
103def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor:

Callers

nothing calls this directly

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected