improve radd support for messagesegment

This commit is contained in:
yanyongyu
2020-12-28 17:39:33 +08:00
parent e14d3d8d73
commit ab61be26a9
2 changed files with 43 additions and 18 deletions

View File

@ -35,6 +35,10 @@ class MessageSegment(BaseMessageSegment):
def __add__(self, other) -> "Message":
return Message(self) + other
@overrides(BaseMessageSegment)
def __radd__(self, other) -> "Message":
return Message(other) + self
@overrides(BaseMessageSegment)
def is_text(self) -> bool:
return self.type == "text"