🔀 Merge pull request #300

Fix: mirai empty message chain when check at
This commit is contained in:
Ju4tCode 2021-03-30 02:55:02 -05:00 committed by GitHub
commit 5db819738e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 22 additions and 4 deletions

View File

@ -214,5 +214,21 @@
"desc": "基于 import hook 的插件管理",
"author": "Jigsaw111",
"repo": "Jigsaw111/nonebot_plugin_manager"
},
{
"id": "nonebot_plugin_analysis_bilibili",
"link": "nonebot-plugin-analysis-bilibili",
"name": "bilibili视频、番剧解析",
"desc": "自动解析bilibili视频、番剧解析",
"author": "mengshouer",
"repo": "mengshouer/nonebot_plugin_analysis_bilibili"
},
{
"id": "nonebot_plugin_localstore",
"link": "nonebot-plugin-localstore",
"name": "本地数据存储",
"desc": "存储插件数据至本地文件",
"author": "yanyongyu",
"repo": "nonebot/plugin-localstore"
}
]

View File

@ -11,7 +11,7 @@ from nonebot.message import handle_event
from nonebot.utils import escape_tag, logger_wrapper
from .event import Event, GroupMessage, MessageEvent, MessageSource
from .message import MessageType
from .message import MessageType, MessageSegment
if TYPE_CHECKING:
from .bot import Bot
@ -138,6 +138,8 @@ def process_at(bot: "Bot", event: GroupMessage) -> GroupMessage:
event.to_me = True
else:
event.message_chain.insert(0, at)
if not event.message_chain:
event.message_chain.append(MessageSegment.plain(''))
return event