From 775140cf79abb907f85de59b7e13a18d6cc888b9 Mon Sep 17 00:00:00 2001 From: HibiKier <775757368@qq.com> Date: Fri, 9 Sep 2022 22:41:39 +0800 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=AE=9A=E4=B9=89=E7=BE=A4=E6=AC=A2?= =?UTF-8?q?=E8=BF=8E=E6=B6=88=E6=81=AF=E5=8F=82=E6=95=B0=E4=B8=8D=E5=AE=8C?= =?UTF-8?q?=E5=85=A8=E6=97=B6=E6=8F=90=E7=A4=BA=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 4 ++++ basic_plugins/admin_bot_manage/custom_welcome_message.py | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b40ba496..64936bfe 100644 --- a/README.md +++ b/README.md @@ -279,6 +279,10 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能 ## 更新 +### 2022/9/10 + +* 自定义群欢迎消息参数不完全时提示报错 + ### 2022/9/8 * 添加插件数据初始化判断 diff --git a/basic_plugins/admin_bot_manage/custom_welcome_message.py b/basic_plugins/admin_bot_manage/custom_welcome_message.py index 5b656b5d..1b82f421 100755 --- a/basic_plugins/admin_bot_manage/custom_welcome_message.py +++ b/basic_plugins/admin_bot_manage/custom_welcome_message.py @@ -36,11 +36,11 @@ custom_welcome = on_command( @custom_welcome.handle() async def _(event: GroupMessageEvent, arg: Message = CommandArg()): + msg = arg.extract_plain_text().strip() + img = get_message_img(event.json()) + if not msg and not img: + await custom_welcome.finish(__plugin_usage__) try: - msg = arg.extract_plain_text().strip() - img = get_message_img(event.json()) - if not msg and not img: - await custom_welcome.finish(__plugin_usage__) await custom_welcome.send( await custom_group_welcome(msg, img, event.user_id, event.group_id), at_sender=True,