mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-12-18 09:25:46 +08:00
📝 fix sphinx build errors
This commit is contained in:
parent
0ce3ee6c20
commit
571cdef826
@ -245,12 +245,12 @@ message += MessageSegment.atDingtalkIds(event.senderId)
|
||||
|
||||
### _static_ `extension(dict_)`
|
||||
|
||||
"标记 text 文本的 extension 属性,需要与 text 消息段相加。
|
||||
标记 text 文本的 extension 属性,需要与 text 消息段相加。
|
||||
|
||||
|
||||
### _static_ `code(code_language, code)`
|
||||
|
||||
"发送 code 消息段
|
||||
发送 code 消息段
|
||||
|
||||
|
||||
### _static_ `markdown(title, text)`
|
||||
@ -274,7 +274,7 @@ message += MessageSegment.atDingtalkIds(event.senderId)
|
||||
* `btnOrientation`: 0:按钮竖直排列 1:按钮横向排列
|
||||
|
||||
|
||||
* `btns`: [{ "title": title, "actionURL": actionURL }, ...]
|
||||
* `btns`: `[{ "title": title, "actionURL": actionURL }, ...]`
|
||||
|
||||
|
||||
|
||||
@ -286,7 +286,7 @@ message += MessageSegment.atDingtalkIds(event.senderId)
|
||||
* **参数**
|
||||
|
||||
|
||||
* `links`: [{ "title": xxx, "messageURL": xxx, "picURL": xxx }, ...]
|
||||
* `links`: `[{ "title": xxx, "messageURL": xxx, "picURL": xxx }, ...]`
|
||||
|
||||
|
||||
|
||||
|
@ -292,7 +292,7 @@ API中为了使代码更加整洁, 我们采用了与PEP8相符的命名规则
|
||||
* **参数**
|
||||
|
||||
|
||||
* `type: str`: "friend" 或 "group" 或 "temp"
|
||||
* `type: str`: “friend” 或 “group” 或 “temp”
|
||||
|
||||
|
||||
* `img: BytesIO`: 图片的BytesIO对象
|
||||
@ -311,7 +311,7 @@ API中为了使代码更加整洁, 我们采用了与PEP8相符的命名规则
|
||||
* **参数**
|
||||
|
||||
|
||||
* `type: str`: 当前仅支持 "group"
|
||||
* `type: str`: 当前仅支持 “group”
|
||||
|
||||
|
||||
* `voice: BytesIO`: 语音的BytesIO对象
|
||||
|
@ -262,12 +262,12 @@ Reverse Driver 基类。将后端框架封装,以满足适配器使用。
|
||||
|
||||
### `http_version`
|
||||
|
||||
One of "1.0", "1.1" or "2".
|
||||
One of `"1.0"`, `"1.1"` or `"2"`.
|
||||
|
||||
|
||||
### `scheme`
|
||||
|
||||
URL scheme portion (likely "http" or "https").
|
||||
URL scheme portion (likely `"http"` or `"https"`).
|
||||
|
||||
|
||||
### `path`
|
||||
@ -279,7 +279,7 @@ decoded into characters.
|
||||
|
||||
### `query_string`
|
||||
|
||||
URL portion after the ?, percent-encoded.
|
||||
URL portion after the `?`, percent-encoded.
|
||||
|
||||
|
||||
### `headers`
|
||||
@ -314,7 +314,7 @@ The HTTP method name, uppercased.
|
||||
|
||||
Body of the request.
|
||||
|
||||
Optional; if missing defaults to b"".
|
||||
Optional; if missing defaults to `b""`.
|
||||
|
||||
|
||||
### _property_ `type`
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.adapters 模块
|
||||
=====================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.adapters.cqhttp 模块
|
||||
=============================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.adapters.ding 模块
|
||||
===========================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.adapters.feishu 模块
|
||||
============================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.adapters.mirai 模块
|
||||
===========================
|
||||
|
@ -46,7 +46,7 @@ templates_path = ['_templates']
|
||||
#
|
||||
# This is also used if you do content translation via gettext catalogs.
|
||||
# Usually you set "language" from the command line for these cases.
|
||||
language = 'zh'
|
||||
language = 'zh_CN'
|
||||
|
||||
master_doc = "README"
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.config 模块
|
||||
===================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.drivers 模块
|
||||
=====================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.drivers.fastapi 模块
|
||||
=============================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.drivers.quart 模块
|
||||
==========================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.exception 模块
|
||||
======================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.handler 模块
|
||||
====================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.log 模块
|
||||
=================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.matcher 模块
|
||||
====================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.message 模块
|
||||
======================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot 模块
|
||||
===============
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.permission 模块
|
||||
=======================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.plugin 模块
|
||||
====================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.rule 模块
|
||||
====================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.typing 模块
|
||||
===================
|
||||
|
@ -1,7 +1,7 @@
|
||||
---
|
||||
\-\-\-
|
||||
contentSidebar: true
|
||||
sidebarDepth: 0
|
||||
---
|
||||
\-\-\-
|
||||
|
||||
NoneBot.utils 模块
|
||||
==================
|
||||
|
@ -192,7 +192,6 @@ class Driver(abc.ABC):
|
||||
asyncio.create_task(_run_hook(bot))
|
||||
|
||||
|
||||
# TODO: issue #240
|
||||
class ForwardDriver(Driver):
|
||||
|
||||
@abc.abstractmethod
|
||||
@ -239,9 +238,9 @@ class ReverseDriver(Driver):
|
||||
@dataclass
|
||||
class HTTPConnection(abc.ABC):
|
||||
http_version: str
|
||||
"""One of `"1.0"`, `"1.1"` or `"2"`."""
|
||||
"""One of ``"1.0"``, ``"1.1"`` or ``"2"``."""
|
||||
scheme: str
|
||||
"""URL scheme portion (likely `"http"` or `"https"`)."""
|
||||
"""URL scheme portion (likely ``"http"`` or ``"https"``)."""
|
||||
path: str
|
||||
"""
|
||||
HTTP request target excluding any query string,
|
||||
@ -249,7 +248,7 @@ class HTTPConnection(abc.ABC):
|
||||
decoded into characters.
|
||||
"""
|
||||
query_string: bytes = b""
|
||||
""" URL portion after the `?`, percent-encoded."""
|
||||
""" URL portion after the ``?``, percent-encoded."""
|
||||
headers: Dict[str, str] = field(default_factory=dict)
|
||||
"""A dict of name-value pairs,
|
||||
where name is the header name, and value is the header value.
|
||||
@ -279,7 +278,7 @@ class HTTPRequest(HTTPConnection):
|
||||
body: bytes = b""
|
||||
"""Body of the request.
|
||||
|
||||
Optional; if missing defaults to b"".
|
||||
Optional; if missing defaults to ``b""``.
|
||||
"""
|
||||
|
||||
@property
|
||||
|
@ -12,13 +12,17 @@ NoneBot 使用 `loguru`_ 来记录日志信息。
|
||||
|
||||
import sys
|
||||
import logging
|
||||
from typing import Union
|
||||
from typing import Union, TYPE_CHECKING
|
||||
|
||||
import loguru
|
||||
from loguru._logger import Logger
|
||||
|
||||
if TYPE_CHECKING:
|
||||
# avoid sphinx autodoc resolve annotation failed
|
||||
# because loguru module do not have `Logger` class actually
|
||||
from loguru import Logger
|
||||
|
||||
# logger = logging.getLogger("nonebot")
|
||||
logger: "Logger" = loguru.logger # type: ignore
|
||||
logger: "Logger" = loguru.logger
|
||||
"""
|
||||
:说明:
|
||||
|
||||
|
@ -60,12 +60,12 @@ class MessageSegment(BaseMessageSegment["Message"]):
|
||||
|
||||
@staticmethod
|
||||
def extension(dict_: dict) -> "MessageSegment":
|
||||
""""标记 text 文本的 extension 属性,需要与 text 消息段相加。"""
|
||||
"""标记 text 文本的 extension 属性,需要与 text 消息段相加。"""
|
||||
return MessageSegment("extension", dict_)
|
||||
|
||||
@staticmethod
|
||||
def code(code_language: str, code: str) -> "Message":
|
||||
""""发送 code 消息段"""
|
||||
"""发送 code 消息段"""
|
||||
message = MessageSegment.text(code)
|
||||
message += MessageSegment.extension({
|
||||
"text_type": "code_snippet",
|
||||
@ -110,7 +110,7 @@ class MessageSegment(BaseMessageSegment["Message"]):
|
||||
:参数:
|
||||
|
||||
* ``btnOrientation``: 0:按钮竖直排列 1:按钮横向排列
|
||||
* ``btns``: [{ "title": title, "actionURL": actionURL }, ...]
|
||||
* ``btns``: ``[{ "title": title, "actionURL": actionURL }, ...]``
|
||||
"""
|
||||
return MessageSegment(
|
||||
"actionCard", {
|
||||
@ -128,7 +128,7 @@ class MessageSegment(BaseMessageSegment["Message"]):
|
||||
|
||||
:参数:
|
||||
|
||||
* ``links``: [{ "title": xxx, "messageURL": xxx, "picURL": xxx }, ...]
|
||||
* ``links``: ``[{ "title": xxx, "messageURL": xxx, "picURL": xxx }, ...]``
|
||||
"""
|
||||
return MessageSegment("feedCard", {"links": links})
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user