mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-31 01:59:58 +00:00
🔊 improve message logging
This commit is contained in:
@ -44,8 +44,9 @@ class MessageSegment(BaseMessageSegment):
|
||||
|
||||
@overrides(BaseMessageSegment)
|
||||
def __str__(self) -> str:
|
||||
if self.is_text():
|
||||
return self.data.get('text', '')
|
||||
return self.data['text'] if self.is_text() else repr(self)
|
||||
|
||||
def __repr__(self) -> str:
|
||||
return '[mirai:%s]' % ','.join([
|
||||
self.type.value,
|
||||
*map(
|
||||
|
Reference in New Issue
Block a user