Skip to content

Commit

Permalink
🔥 remove Message.__init__ method of mirai adapter
Browse files Browse the repository at this point in the history
  • Loading branch information
mnixry committed Oct 2, 2021
1 parent c8a8ff2 commit 5cff808
Showing 1 changed file with 0 additions and 16 deletions.
16 changes: 0 additions & 16 deletions packages/nonebot-adapter-mirai/nonebot/adapters/mirai/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]]
Expand Down

0 comments on commit 5cff808

Please sign in to comment.