mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 01:18:19 +08:00
🚑 fix message segment get
This commit is contained in:
parent
af7f42ac60
commit
d9ea95c67e
@ -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":
|
||||
|
Loading…
Reference in New Issue
Block a user