🔀 Merge pull request #140

fix empty array process error
This commit is contained in:
Ju4tCode 2021-01-04 13:32:16 +08:00 committed by GitHub
commit 6b26cecd17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -82,6 +82,10 @@ def _check_at_me(bot: "Bot", event: "Event"):
if not isinstance(event, MessageEvent): if not isinstance(event, MessageEvent):
return return
# ensure message not empty
if not event.message:
event.message.append(MessageSegment.text(""))
if event.message_type == "private": if event.message_type == "private":
event.to_me = True event.to_me = True
else: else: