Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修复文档错误 #104

Merged
merged 2 commits into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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