mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 09:38:21 +08:00
📝 Correct params of hook functions
This commit is contained in:
parent
48fae782d7
commit
b7e5ce88ea
@ -15,7 +15,7 @@ from nonebot.exception import IgnoredException
|
||||
|
||||
|
||||
@event_preprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(bot: Bot, event: Event, state: T_State):
|
||||
raise IgnoredException("reason")
|
||||
```
|
||||
:::
|
||||
@ -26,7 +26,7 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
||||
from nonebot.message import event_preprocessor
|
||||
|
||||
@event_preprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(bot: Bot, event: Event, state: T_State):
|
||||
pass
|
||||
```
|
||||
|
||||
@ -36,7 +36,7 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
||||
from nonebot.message import event_postprocessor
|
||||
|
||||
@event_postprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(bot: Bot, event: Event, state: T_State):
|
||||
pass
|
||||
```
|
||||
|
||||
@ -55,6 +55,6 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
||||
from nonebot.message import run_postprocessor
|
||||
|
||||
@run_postprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(matcher: Matcher, exception: Optional[Exception], bot: Bot, event: Event, state: T_State):
|
||||
pass
|
||||
```
|
@ -15,7 +15,7 @@ from nonebot.exception import IgnoredException
|
||||
|
||||
|
||||
@event_preprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(bot: Bot, event: Event, state: T_State):
|
||||
raise IgnoredException("reason")
|
||||
```
|
||||
:::
|
||||
@ -26,7 +26,7 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
||||
from nonebot.message import event_preprocessor
|
||||
|
||||
@event_preprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(bot: Bot, event: Event, state: T_State):
|
||||
pass
|
||||
```
|
||||
|
||||
@ -36,7 +36,7 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
||||
from nonebot.message import event_postprocessor
|
||||
|
||||
@event_postprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(bot: Bot, event: Event, state: T_State):
|
||||
pass
|
||||
```
|
||||
|
||||
@ -55,6 +55,6 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
||||
from nonebot.message import run_postprocessor
|
||||
|
||||
@run_postprocessor
|
||||
async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State):
|
||||
async def do_something(matcher: Matcher, exception: Optional[Exception], bot: Bot, event: Event, state: T_State):
|
||||
pass
|
||||
```
|
Loading…
Reference in New Issue
Block a user