⚗️ rewrite echo and say builtin plugin

This commit is contained in:
yanyongyu
2020-10-04 18:10:01 +08:00
parent 0a11bd3e8e
commit 781d0cf654
5 changed files with 39 additions and 8 deletions

View File

@ -265,7 +265,7 @@ class BaseMessageSegment(abc.ABC):
- 类型: ``str``
- 说明: 消息段类型
"""
data: Dict[str, Union[str, list]] = field(default_factory=lambda: {})
data: Dict[str, Any] = field(default_factory=lambda: {})
"""
- 类型: ``Dict[str, Union[str, list]]``
- 说明: 消息段数据
@ -279,6 +279,11 @@ class BaseMessageSegment(abc.ABC):
def __add__(self, other):
raise NotImplementedError
@classmethod
@abc.abstractmethod
def text(cls, text: str) -> "BaseMessageSegment":
return cls("text", {"text": text})
class BaseMessage(list, abc.ABC):
"""消息数组"""