🚑 fix message segment get

This commit is contained in:
yanyongyu 2020-11-01 19:20:18 +08:00
parent af7f42ac60
commit d9ea95c67e

View File

@ -286,6 +286,9 @@ class BaseMessageSegment(abc.ABC):
def __setitem__(self, key, value):
return setattr(self, key, value)
def get(self, key, default=None):
return getattr(self, key, default)
@classmethod
@abc.abstractmethod
def text(cls, text: str) -> "BaseMessageSegment":