From bc5391d7116465f5131884f3c61b3b45c5e988c8 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Mon, 4 Jan 2021 13:27:49 +0800 Subject: [PATCH] :bug: ensure message is not empty --- nonebot/adapters/cqhttp/bot.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/nonebot/adapters/cqhttp/bot.py b/nonebot/adapters/cqhttp/bot.py index 1aff6d5d..d62ff829 100644 --- a/nonebot/adapters/cqhttp/bot.py +++ b/nonebot/adapters/cqhttp/bot.py @@ -82,6 +82,10 @@ def _check_at_me(bot: "Bot", event: "Event"): if not isinstance(event, MessageEvent): return + # ensure message not empty + if not event.message: + event.message.append(MessageSegment.text("")) + if event.message_type == "private": event.to_me = True else: