mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-31 23:51:28 +08:00
🐛 fix message segment getitem
This commit is contained in:
parent
ce758a2231
commit
f164d85c5c
@ -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":
|
||||||
|
Loading…
x
Reference in New Issue
Block a user