mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-02-17 16:20:05 +08:00
📝 Docs: 补充 get_last_receive
示例 (#2278)
This commit is contained in:
parent
be458b1d5e
commit
37d7230949
@ -374,6 +374,14 @@ async def _(matcher: Matcher):
|
||||
|
||||
`get_last_receive` 操作接受一个可选的 default 参数。当事件不存在时,将返回 default 或 `None`。
|
||||
|
||||
```python
|
||||
from nonebot.matcher import Matcher
|
||||
|
||||
@matcher.handle()
|
||||
async def _(matcher: Matcher):
|
||||
event = matcher.get_last_receive(default=None)
|
||||
```
|
||||
|
||||
### set_receive
|
||||
|
||||
设置 / 覆盖一个 `receive` 接收的事件。
|
||||
|
@ -374,6 +374,14 @@ async def _(matcher: Matcher):
|
||||
|
||||
`get_last_receive` 操作接受一个可选的 default 参数。当事件不存在时,将返回 default 或 `None`。
|
||||
|
||||
```python
|
||||
from nonebot.matcher import Matcher
|
||||
|
||||
@matcher.handle()
|
||||
async def _(matcher: Matcher):
|
||||
event = matcher.get_last_receive(default=None)
|
||||
```
|
||||
|
||||
### set_receive
|
||||
|
||||
设置 / 覆盖一个 `receive` 接收的事件。
|
||||
|
@ -374,6 +374,14 @@ async def _(matcher: Matcher):
|
||||
|
||||
`get_last_receive` 操作接受一个可选的 default 参数。当事件不存在时,将返回 default 或 `None`。
|
||||
|
||||
```python
|
||||
from nonebot.matcher import Matcher
|
||||
|
||||
@matcher.handle()
|
||||
async def _(matcher: Matcher):
|
||||
event = matcher.get_last_receive(default=None)
|
||||
```
|
||||
|
||||
### set_receive
|
||||
|
||||
设置 / 覆盖一个 `receive` 接收的事件。
|
||||
|
@ -374,6 +374,14 @@ async def _(matcher: Matcher):
|
||||
|
||||
`get_last_receive` 操作接受一个可选的 default 参数。当事件不存在时,将返回 default 或 `None`。
|
||||
|
||||
```python
|
||||
from nonebot.matcher import Matcher
|
||||
|
||||
@matcher.handle()
|
||||
async def _(matcher: Matcher):
|
||||
event = matcher.get_last_receive(default=None)
|
||||
```
|
||||
|
||||
### set_receive
|
||||
|
||||
设置 / 覆盖一个 `receive` 接收的事件。
|
||||
|
Loading…
x
Reference in New Issue
Block a user