Skip to content

Commit

Permalink
自定义群欢迎消息参数不完全时提示报错
Browse files Browse the repository at this point in the history
  • Loading branch information
HibiKier committed Sep 9, 2022
1 parent 6a8a796 commit 775140c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -279,6 +279,10 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能

## 更新

### 2022/9/10

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

### 2022/9/8

* 添加插件数据初始化判断
Expand Down
8 changes: 4 additions & 4 deletions basic_plugins/admin_bot_manage/custom_welcome_message.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@

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

0 comments on commit 775140c

Please sign in to comment.