Skip to content

Commit

Permalink
📝 修复文档错误 (#104)
Browse files Browse the repository at this point in the history
* 📝 修复示例代码中装饰器缺少的 `@` 符号

* 📝 修复注释错误
  • Loading branch information
montmorill authored Oct 21, 2023
1 parent 25c4f8e commit 0c99615
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ async def handle(event: MessageEvent):
```python
from nonebot_plugin_saa import TargetQQGroup

# 发送目标为 QQ 号 10000, 以私聊形式发送
target = TargetQQGroup(group_id=2233)
# 发送目标为群号 114514 的群聊
target = TargetQQGroup(group_id=114514)
await MessageFactory("早上好").send_to(target)
```

Expand Down Expand Up @@ -127,13 +127,13 @@ from nonebot.adapters.onebot.v12.bot import Bot as V12Bot

pic_matcher = nonebot.on_command('发送图片')

pic_matcher.handle()
@pic_matcher.handle()
async def _handle_v11(event: V11MessageEvent):
pic_content = ...
msg = V11MessageSegment.image(pic_content) + V11MessageSegment.text("这是你要的图片")
await pic_matcher.finish(msg)

pic_matcher.handle()
@pic_matcher.handle()
async def _handle_v12(bot: V12Bot, event: V12MessageEvent):
pic_content = ...
pic_file = await bot.upload_file(type='data', name='image', data=pic_content)
Expand All @@ -151,7 +151,7 @@ from nonebot_plugin_saa import Image, Text, MessageFactory

pic_matcher = nonebot.on_command('发送图片')

pic_matcher.handle()
@pic_matcher.handle()
async def _handle_v12(bot: Bot, event: Union[V12MessageEvent, V11MessageEvent]):
pic_content = ...
msg_builder = MessageFactory([
Expand Down

0 comments on commit 0c99615

Please sign in to comment.