From 22c7371f2e0487107ff1ccab7bb13dc8bb22dccf Mon Sep 17 00:00:00 2001 From: Mix Date: Thu, 19 Aug 2021 01:36:51 +0800 Subject: [PATCH] :bug: Fix exception raised when trying to construct message from plain --- .../nonebot-adapter-mirai/nonebot/adapters/mirai/message.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py b/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py index c7ad6841..34ea948f 100644 --- a/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py +++ b/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py @@ -295,8 +295,7 @@ class MessageChain(BaseMessage[MessageSegment]): self, message: Union[List[Dict[str, Any]], Iterable[MessageSegment]] ) -> List[MessageSegment]: if isinstance(message, str): - raise ValueError( - "String operation is not supported in mirai adapter") + return [MessageSegment.plain(text=message)] return [ *map( lambda x: x