mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-01-19 09:38:21 +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):
|
||||
raise NotImplementedError
|
||||
|
||||
def __getitem__(self, key):
|
||||
return getattr(self, key)
|
||||
|
||||
@classmethod
|
||||
@abc.abstractmethod
|
||||
def text(cls, text: str) -> "BaseMessageSegment":
|
||||
|
Loading…
Reference in New Issue
Block a user