令参数符合标准

This commit is contained in:
hemengyang
2022-01-12 18:31:12 +08:00
parent a5f32febbd
commit 456d333568
17 changed files with 85 additions and 170 deletions

View File

@ -14,8 +14,7 @@ def load_plugin(module_path: str) -> Optional[Plugin]:
"""
使用 `PluginManager` 加载单个插件,可以是本地插件或是通过 `pip` 安装的插件。
:参数:
参数:
module_path: 插件名称 `path.to.your.plugin`
:返回:
@ -32,8 +31,7 @@ def load_plugins(*plugin_dir: str) -> Set[Plugin]:
"""
导入目录下多个插件,以 `_` 开头的插件不会被导入!
:参数:
参数:
- `*plugin_dir: str`: 插件路径
:返回:
@ -51,8 +49,7 @@ def load_all_plugins(
"""
导入指定列表中的插件以及指定目录下多个插件,以 `_` 开头的插件不会被导入!
:参数:
参数:
- `module_path: Iterable[str]`: 指定插件集合
- `plugin_dir: Iterable[str]`: 指定插件路径集合
@ -69,8 +66,7 @@ def load_from_json(file_path: str, encoding: str = "utf-8") -> Set[Plugin]:
"""
导入指定 json 文件中的 `plugins` 以及 `plugin_dirs` 下多个插件,以 `_` 开头的插件不会被导入!
:参数:
参数:
- `file_path: str`: 指定 json 文件路径
- `encoding: str`: 指定 json 文件编码
@ -92,8 +88,7 @@ def load_from_toml(file_path: str, encoding: str = "utf-8") -> Set[Plugin]:
导入指定 toml 文件 `[tool.nonebot]` 中的 `plugins` 以及 `plugin_dirs` 下多个插件,
以 `_` 开头的插件不会被导入!
:参数:
参数:
- `file_path: str`: 指定 toml 文件路径
- `encoding: str`: 指定 toml 文件编码
@ -147,8 +142,7 @@ def require(name: str) -> Export:
"""
获取一个插件的导出内容
:参数:
参数:
name: 插件名,与 `load_plugin` 参数一致。如果为 `load_plugins` 导入的插件,则为文件(夹)名。
:返回: