mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-09-11 14:36:58 +00:00
🐛 fix message segment getitem
This commit is contained in:
@ -282,6 +282,9 @@ class BaseMessageSegment(abc.ABC):
|
|||||||
def __add__(self, other):
|
def __add__(self, other):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
def __getitem__(self, key):
|
||||||
|
return getattr(self, key)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@abc.abstractmethod
|
@abc.abstractmethod
|
||||||
def text(cls, text: str) -> "BaseMessageSegment":
|
def text(cls, text: str) -> "BaseMessageSegment":
|
||||||
|
Reference in New Issue
Block a user