事件预处理。 装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。
(func: T_EventPreProcessor)
| 90 | |
| 91 | |
| 92 | def 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 | |
| 103 | def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor: |