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