mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 00:55:07 +08:00
♿ change hook parse typing
This commit is contained in:
parent
ec9e8511b7
commit
e720584044
@ -72,7 +72,7 @@ RUN_POSTPCS_PARAMS = [
|
|||||||
def event_preprocessor(func: T_EventPreProcessor) -> T_EventPreProcessor:
|
def event_preprocessor(func: T_EventPreProcessor) -> T_EventPreProcessor:
|
||||||
"""事件预处理。装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。"""
|
"""事件预处理。装饰一个函数,使它在每次接收到事件并分发给各响应器之前执行。"""
|
||||||
_event_preprocessors.add(
|
_event_preprocessors.add(
|
||||||
Dependent[None].parse(call=func, allow_types=EVENT_PCS_PARAMS)
|
Dependent[Any].parse(call=func, allow_types=EVENT_PCS_PARAMS)
|
||||||
)
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
@ -80,7 +80,7 @@ def event_preprocessor(func: T_EventPreProcessor) -> T_EventPreProcessor:
|
|||||||
def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor:
|
def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor:
|
||||||
"""事件后处理。装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。"""
|
"""事件后处理。装饰一个函数,使它在每次接收到事件并分发给各响应器之后执行。"""
|
||||||
_event_postprocessors.add(
|
_event_postprocessors.add(
|
||||||
Dependent[None].parse(call=func, allow_types=EVENT_PCS_PARAMS)
|
Dependent[Any].parse(call=func, allow_types=EVENT_PCS_PARAMS)
|
||||||
)
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
@ -88,7 +88,7 @@ def event_postprocessor(func: T_EventPostProcessor) -> T_EventPostProcessor:
|
|||||||
def run_preprocessor(func: T_RunPreProcessor) -> T_RunPreProcessor:
|
def run_preprocessor(func: T_RunPreProcessor) -> T_RunPreProcessor:
|
||||||
"""运行预处理。装饰一个函数,使它在每次事件响应器运行前执行。"""
|
"""运行预处理。装饰一个函数,使它在每次事件响应器运行前执行。"""
|
||||||
_run_preprocessors.add(
|
_run_preprocessors.add(
|
||||||
Dependent[None].parse(call=func, allow_types=RUN_PREPCS_PARAMS)
|
Dependent[Any].parse(call=func, allow_types=RUN_PREPCS_PARAMS)
|
||||||
)
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
@ -96,7 +96,7 @@ def run_preprocessor(func: T_RunPreProcessor) -> T_RunPreProcessor:
|
|||||||
def run_postprocessor(func: T_RunPostProcessor) -> T_RunPostProcessor:
|
def run_postprocessor(func: T_RunPostProcessor) -> T_RunPostProcessor:
|
||||||
"""运行后处理。装饰一个函数,使它在每次事件响应器运行后执行。"""
|
"""运行后处理。装饰一个函数,使它在每次事件响应器运行后执行。"""
|
||||||
_run_postprocessors.add(
|
_run_postprocessors.add(
|
||||||
Dependent[None].parse(call=func, allow_types=RUN_POSTPCS_PARAMS)
|
Dependent[Any].parse(call=func, allow_types=RUN_POSTPCS_PARAMS)
|
||||||
)
|
)
|
||||||
return func
|
return func
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user