From 5cff80812e38c75be8795c6c712bb960b9158a60 Mon Sep 17 00:00:00 2001 From: Mix <32300164+mnixry@users.noreply.github.com> Date: Sat, 2 Oct 2021 13:56:51 +0800 Subject: [PATCH] :fire: remove `Message.__init__` method of mirai adapter --- .../nonebot/adapters/mirai/message.py | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py b/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py index 34ea948f..14d6f9e8 100644 --- a/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py +++ b/packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py @@ -274,22 +274,6 @@ class MessageChain(BaseMessage[MessageSegment]): def get_segment_class(cls) -> Type[MessageSegment]: return MessageSegment - @overrides(BaseMessage) - def __init__(self, message: Union[List[Dict[str, - Any]], Iterable[MessageSegment], - MessageSegment, str], **kwargs): - super().__init__(**kwargs) - if isinstance(message, MessageSegment): - self.append(message) - elif isinstance(message, str): - self.append(MessageSegment.plain(text=message)) - elif isinstance(message, Iterable): - self.extend(self._construct(message)) - else: - raise ValueError( - f'Type {type(message).__name__} is not supported in mirai adapter.' - ) - @overrides(BaseMessage) def _construct( self, message: Union[List[Dict[str, Any]], Iterable[MessageSegment]]