🔀 Merge pull request #272

Fix: errors in doc
This commit is contained in:
Ju4tCode 2021-03-07 08:34:03 -06:00 committed by GitHub
commit 4661adc564
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 70 additions and 14 deletions

View File

@ -49,14 +49,14 @@
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
v-model="newPlugin.id" v-model="newPlugin.link"
label="PyPI 项目名" label="PyPI 项目名"
required required
></v-text-field> ></v-text-field>
</v-col> </v-col>
<v-col cols="12"> <v-col cols="12">
<v-text-field <v-text-field
v-model="newPlugin.link" v-model="newPlugin.id"
label="插件 import 包名" label="插件 import 包名"
required required
></v-text-field> ></v-text-field>

View File

@ -9,7 +9,7 @@
}, },
{ {
"id": "nonebot.adapters.ding", "id": "nonebot.adapters.ding",
"link": "nonebot-adapter-cqhttp", "link": "nonebot-adapter-ding",
"name": "ding", "name": "ding",
"desc": "钉钉协议", "desc": "钉钉协议",
"author": "Artin", "author": "Artin",

View File

@ -208,8 +208,8 @@
"repo": "knva/nonebot_plugin_biliav" "repo": "knva/nonebot_plugin_biliav"
}, },
{ {
"id": "nonebot-plugin-manager", "id": "nonebot_plugin_manager",
"link": "nonebot_plugin_manager", "link": "nonebot-plugin-manager",
"name": "插件管理器", "name": "插件管理器",
"desc": "基于 import hook 的插件管理", "desc": "基于 import hook 的插件管理",
"author": "Jigsaw111", "author": "Jigsaw111",

View File

@ -28,7 +28,7 @@ FastAPI 驱动框架设置,详情参考 FastAPI 文档
* **说明** * **说明**
openapi.json 地址,默认为 None 即关闭 `openapi.json` 地址,默认为 `None` 即关闭
@ -43,7 +43,7 @@ FastAPI 驱动框架设置,详情参考 FastAPI 文档
* **说明** * **说明**
swagger 地址,默认为 None 即关闭 `swagger` 地址,默认为 `None` 即关闭
@ -58,7 +58,22 @@ FastAPI 驱动框架设置,详情参考 FastAPI 文档
* **说明** * **说明**
redoc 地址,默认为 None 即关闭 `redoc` 地址,默认为 `None` 即关闭
### `fastapi_reload_dirs`
* **类型**
`List[str]`
* **说明**
`debug` 模式下重载监控文件夹列表,默认为 uvicorn 默认值

View File

@ -1,5 +1,11 @@
# CQHTTP 协议使用指南 # CQHTTP 协议使用指南
## 安装 NoneBot CQHTTP 适配器
```bash
pip install nonebot-adapter-cqhttp
```
## 配置 CQHTTP 协议端(以 QQ 为例) ## 配置 CQHTTP 协议端(以 QQ 为例)
单纯运行 NoneBot 实例并不会产生任何效果,因为此刻 QQ 这边还不知道 NoneBot 的存在,也就无法把消息发送给它,因此现在需要使用一个无头 QQ 来把消息等事件上报给 NoneBot。 单纯运行 NoneBot 实例并不会产生任何效果,因为此刻 QQ 这边还不知道 NoneBot 的存在,也就无法把消息发送给它,因此现在需要使用一个无头 QQ 来把消息等事件上报给 NoneBot。

View File

@ -11,6 +11,12 @@
- [群机器人概述](https://developers.dingtalk.com/document/app/overview-of-group-robots) - [群机器人概述](https://developers.dingtalk.com/document/app/overview-of-group-robots)
- [开发企业内部机器人](https://developers.dingtalk.com/document/app/develop-enterprise-internal-robots) - [开发企业内部机器人](https://developers.dingtalk.com/document/app/develop-enterprise-internal-robots)
## 安装 NoneBot 钉钉 适配器
```bash
pip install nonebot-adapter-ding
```
## 关于 DingAdapter 的说明 ## 关于 DingAdapter 的说明
你需要显式的注册 ding 这个适配器: 你需要显式的注册 ding 这个适配器:

View File

@ -1,6 +1,6 @@
# 安装 # 安装
## NoneBot ## 安装 NoneBot
:::warning 注意 :::warning 注意
请确保你的 Python 版本 >= 3.7。 请确保你的 Python 版本 >= 3.7。
@ -67,6 +67,18 @@ poetry install --no-dev # 推荐
pip install . # 不推荐 pip install . # 不推荐
``` ```
## 安装适配器
适配器可以通过 `nb-cli` 在创建项目时根据你的选择自动安装,也可以自行使用 `pip` 安装
```bash
pip install nonebot-adapter-<adapter-name>
```
```bash
# 列出所有的适配器
nb adapter list
```
## 安装插件 ## 安装插件
插件可以通过 `nb-cli` 进行安装,也可以自行安装并加载插件。 插件可以通过 `nb-cli` 进行安装,也可以自行安装并加载插件。

View File

@ -28,6 +28,12 @@ Mirai-API-HTTP 的适配器以 [AGPLv3 许可](https://opensource.org/licenses/A
**为了便捷起见, 以下内容均以缩写 `MAH` 代替 `mirai-api-http`** **为了便捷起见, 以下内容均以缩写 `MAH` 代替 `mirai-api-http`**
## 安装 NoneBot Mirai 适配器
```bash
pip install nonebot-adapter-mirai
```
## 配置 MAH 客户端 ## 配置 MAH 客户端
正如你可能刚刚在[CQHTTP 协议使用指南](./cqhttp-guide.md)中所读到的: 正如你可能刚刚在[CQHTTP 协议使用指南](./cqhttp-guide.md)中所读到的:

View File

@ -11,7 +11,7 @@ FastAPI 驱动适配
import json import json
import asyncio import asyncio
import logging import logging
from typing import Optional, Callable from typing import List, Optional, Callable
import uvicorn import uvicorn
from pydantic import BaseSettings from pydantic import BaseSettings
@ -39,7 +39,7 @@ class Config(BaseSettings):
:说明: :说明:
`openapi.json` 地址默认为 `None` 即关闭 ``openapi.json`` 地址默认为 ``None`` 即关闭
""" """
fastapi_docs_url: Optional[str] = None fastapi_docs_url: Optional[str] = None
""" """
@ -49,7 +49,7 @@ class Config(BaseSettings):
:说明: :说明:
`swagger` 地址默认为 `None` 即关闭 ``swagger`` 地址默认为 ``None`` 即关闭
""" """
fastapi_redoc_url: Optional[str] = None fastapi_redoc_url: Optional[str] = None
""" """
@ -59,7 +59,17 @@ class Config(BaseSettings):
:说明: :说明:
`redoc` 地址默认为 `None` 即关闭 ``redoc`` 地址默认为 ``None`` 即关闭
"""
fastapi_reload_dirs: List[str] = []
"""
:类型:
``List[str]``
:说明:
``debug`` 模式下重载监控文件夹列表默认为 uvicorn 默认值
""" """
class Config: class Config:
@ -161,6 +171,7 @@ class Driver(BaseDriver):
host=host or str(self.config.host), host=host or str(self.config.host),
port=port or self.config.port, port=port or self.config.port,
reload=bool(app) and self.config.debug, reload=bool(app) and self.config.debug,
reload_dirs=self.fastapi_config.fastapi_reload_dirs or None,
debug=self.config.debug, debug=self.config.debug,
log_config=LOGGING_CONFIG, log_config=LOGGING_CONFIG,
**kwargs) **kwargs)

View File

@ -88,7 +88,7 @@ class PluginManager:
if hasattr(_internal_space, internal_id): if hasattr(_internal_space, internal_id):
raise RuntimeError("Plugin manager already exists!") raise RuntimeError("Plugin manager already exists!")
prefix = sys._getframe(2).f_globals.get( prefix = sys._getframe(3).f_globals.get(
"__name__") or _internal_space.__name__ "__name__") or _internal_space.__name__
if not prefix.startswith(_internal_space.__name__): if not prefix.startswith(_internal_space.__name__):
prefix = _internal_space.__name__ prefix = _internal_space.__name__