From 0c99615d40a5b9d18ddbce113a9248462cb5ada8 Mon Sep 17 00:00:00 2001 From: montmorillonite Date: Sun, 22 Oct 2023 00:48:27 +0800 Subject: [PATCH] =?UTF-8?q?:memo:=20=E4=BF=AE=E5=A4=8D=E6=96=87=E6=A1=A3?= =?UTF-8?q?=E9=94=99=E8=AF=AF=20(#104)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * :memo: 修复示例代码中装饰器缺少的 `@` 符号 * :memo: 修复注释错误 --- README.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index acede90f..c35ef4fe 100644 --- a/README.md +++ b/README.md @@ -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) ``` @@ -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) @@ -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([