📝 Docs: 补充 get_last_receive 示例 (#2278)

This commit is contained in:
Akirami 2023-08-18 11:01:23 +08:00 committed by GitHub
parent be458b1d5e
commit 37d7230949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 32 additions and 0 deletions

View File

@ -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` 接收的事件。

View File

@ -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` 接收的事件。

View File

@ -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` 接收的事件。

View File

@ -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` 接收的事件。