🔀 Merge pull request #19

This commit is contained in:
Ju4tCode 2020-10-03 15:06:46 +08:00 committed by GitHub
commit b80f0bf202
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -344,4 +344,5 @@ class BaseMessage(list, abc.ABC):
def _concat(x: str, y: BaseMessageSegment) -> str:
return f"{x} {y.data['text']}" if y.type == "text" else x
return reduce(_concat, self, "")
plain_text = reduce(_concat, self, "")
return plain_text[1:] if plain_text else plain_text