mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-18 09:25:46 +08:00
🐛 ensure message is not empty
This commit is contained in:
parent
17960b2868
commit
bc5391d711
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user