mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-02-20 09:38:23 +08:00
commit
81edb535a4
@ -15,7 +15,7 @@ from nonebot.exception import IgnoredException
|
|||||||
|
|
||||||
|
|
||||||
@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):
|
||||||
raise IgnoredException("reason")
|
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
|
from nonebot.message import event_preprocessor
|
||||||
|
|
||||||
@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
|
pass
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
|||||||
from nonebot.message import event_postprocessor
|
from nonebot.message import event_postprocessor
|
||||||
|
|
||||||
@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
|
pass
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -55,6 +55,6 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
|||||||
from nonebot.message import run_postprocessor
|
from nonebot.message import run_postprocessor
|
||||||
|
|
||||||
@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
|
pass
|
||||||
```
|
```
|
@ -15,7 +15,7 @@ from nonebot.exception import IgnoredException
|
|||||||
|
|
||||||
|
|
||||||
@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):
|
||||||
raise IgnoredException("reason")
|
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
|
from nonebot.message import event_preprocessor
|
||||||
|
|
||||||
@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
|
pass
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
|||||||
from nonebot.message import event_postprocessor
|
from nonebot.message import event_postprocessor
|
||||||
|
|
||||||
@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
|
pass
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -55,6 +55,6 @@ async def do_something(matcher: Matcher, bot: Bot, event: Event, state: T_State)
|
|||||||
from nonebot.message import run_postprocessor
|
from nonebot.message import run_postprocessor
|
||||||
|
|
||||||
@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
|
pass
|
||||||
```
|
```
|
@ -82,15 +82,6 @@ def something_else():
|
|||||||
* **说明**: 插件模块对象
|
* **说明**: 插件模块对象
|
||||||
|
|
||||||
|
|
||||||
### `matcher`
|
|
||||||
|
|
||||||
|
|
||||||
* **类型**: `Set[Type[Matcher]]`
|
|
||||||
|
|
||||||
|
|
||||||
* **说明**: 插件内定义的 `Matcher`
|
|
||||||
|
|
||||||
|
|
||||||
### `export`
|
### `export`
|
||||||
|
|
||||||
|
|
||||||
@ -100,6 +91,15 @@ def something_else():
|
|||||||
* **说明**: 插件内定义的导出内容
|
* **说明**: 插件内定义的导出内容
|
||||||
|
|
||||||
|
|
||||||
|
### _property_ `matcher`
|
||||||
|
|
||||||
|
|
||||||
|
* **类型**: `Set[Type[Matcher]]`
|
||||||
|
|
||||||
|
|
||||||
|
* **说明**: 插件内定义的 `Matcher`
|
||||||
|
|
||||||
|
|
||||||
## `on(type='', rule=None, permission=None, *, handlers=None, temp=False, priority=1, block=False, state=None, state_factory=None)`
|
## `on(type='', rule=None, permission=None, *, handlers=None, temp=False, priority=1, block=False, state=None, state_factory=None)`
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user