自定义群欢迎消息参数不完全时提示报错

This commit is contained in:
HibiKier 2022-09-09 22:41:39 +08:00
parent 6a8a796add
commit 775140cf79
2 changed files with 8 additions and 4 deletions

View File

@ -279,6 +279,10 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能
## 更新
### 2022/9/10
* 自定义群欢迎消息参数不完全时提示报错
### 2022/9/8
* 添加插件数据初始化判断

View File

@ -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,