From 70c7927006320a24ad38acd48787249f3a72e6bf Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Fri, 30 Oct 2020 16:49:31 +0800 Subject: [PATCH] :bulb: add docstring for cqhttp message --- docs/api/adapters/cqhttp.md | 4 ++++ nonebot/adapters/cqhttp.py | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/docs/api/adapters/cqhttp.md b/docs/api/adapters/cqhttp.md index aae78f86..73b4e044 100644 --- a/docs/api/adapters/cqhttp.md +++ b/docs/api/adapters/cqhttp.md @@ -405,7 +405,11 @@ CQHTTP 协议 Event 适配。继承属性参考 [BaseEvent](./#class-baseevent) 基类:[`nonebot.adapters.BaseMessageSegment`](#None) +CQHTTP 协议 MessageSegment 适配。具体方法参考协议消息段类型或源码。 + ## _class_ `Message` 基类:[`nonebot.adapters.BaseMessage`](#None) + +CQHTTP 协议 Message 适配。 diff --git a/nonebot/adapters/cqhttp.py b/nonebot/adapters/cqhttp.py index 0f214e36..8a895f17 100644 --- a/nonebot/adapters/cqhttp.py +++ b/nonebot/adapters/cqhttp.py @@ -633,6 +633,9 @@ class Event(BaseEvent): class MessageSegment(BaseMessageSegment): + """ + CQHTTP 协议 MessageSegment 适配。具体方法参考协议消息段类型或源码。 + """ @overrides(BaseMessageSegment) def __init__(self, type: str, data: Dict[str, Any]) -> None: @@ -811,6 +814,9 @@ class MessageSegment(BaseMessageSegment): class Message(BaseMessage): + """ + CQHTTP 协议 Message 适配。 + """ @staticmethod @overrides(BaseMessage)