🐛 Fix Message._construct error

This commit is contained in:
Artin
2020-12-03 18:47:58 +08:00
parent afd01796aa
commit be244f4538
2 changed files with 10 additions and 4 deletions

View File

@ -45,8 +45,8 @@ class MessageSegment(BaseMessageSegment):
self.data["at"]["isAtAll"] = value
@staticmethod
def text(text: str) -> "MessageSegment":
return MessageSegment("text", {"text": {"content": text.strip()}})
def text(text_: str) -> "MessageSegment":
return MessageSegment("text", {"text": {"content": text_.strip()}})
@staticmethod
def markdown(title: str, text: str) -> "MessageSegment":
@ -130,4 +130,4 @@ class Message(BaseMessage):
elif isinstance(msg, TextMessage):
yield MessageSegment("text", {"text": msg.dict()})
elif isinstance(msg, str):
yield MessageSegment.text(str)
yield MessageSegment.text(msg)