mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 08:41:29 +00:00
🐛 fix import recursion when same plugin and file name (fix #401)
This commit is contained in:
@ -289,19 +289,6 @@ class MessageChain(BaseMessage[MessageSegment]):
|
||||
f'Type {type(message).__name__} is not supported in mirai adapter.'
|
||||
)
|
||||
|
||||
@overrides(BaseMessage)
|
||||
def reduce(self):
|
||||
"""
|
||||
:说明:
|
||||
|
||||
忽略为空的消息段, 合并相邻的纯文本消息段
|
||||
"""
|
||||
for index, segment in enumerate(self):
|
||||
segment: MessageSegment
|
||||
if segment.is_text() and not str(segment).strip():
|
||||
self.pop(index)
|
||||
super().reduce()
|
||||
|
||||
@overrides(BaseMessage)
|
||||
def _construct(
|
||||
self, message: Union[List[Dict[str, Any]], Iterable[MessageSegment]]
|
||||
|
Reference in New Issue
Block a user