From fbd04a6fbf5b06142826d50b041dc79ee0a2b313 Mon Sep 17 00:00:00 2001 From: StarHeartHunt Date: Wed, 1 Nov 2023 10:24:53 +0800 Subject: [PATCH] :bug: add missing at seg constructor --- nonebot/adapters/feishu/message.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/nonebot/adapters/feishu/message.py b/nonebot/adapters/feishu/message.py index 478f211..c911539 100644 --- a/nonebot/adapters/feishu/message.py +++ b/nonebot/adapters/feishu/message.py @@ -63,6 +63,10 @@ def __radd__( def text(text: str) -> "Text": return Text("text", {"text": str(text)}) + @staticmethod + def at(user_id: str): + return At("at", {"user_id": user_id}) + @staticmethod def post( title: str, content: List[List["PostMessageNode"]], language: str = "zh_cn" @@ -209,20 +213,6 @@ def __str__(self) -> str: return f"@{self.data['user_id']}" -class _AtAllData(TypedDict): - user_id: Literal["all"] - - -@dataclass -class AtAll(MessageSegment): - if TYPE_CHECKING: - data: _AtAllData - - @override - def __str__(self) -> str: - return "@all" - - class _ImageData(TypedDict): image_key: str