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([