mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-31 15:41:34 +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):
|
def __setitem__(self, key, value):
|
||||||
return setattr(self, key, value)
|
return setattr(self, key, value)
|
||||||
|
|
||||||
|
def get(self, key, default=None):
|
||||||
|
return getattr(self, key, default)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def text(cls, text: str) -> "BaseMessageSegment":
|
def text(cls, text: str) -> "BaseMessageSegment":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user