From 83287c717610013be89752ef3ff4cb3cfb078777 Mon Sep 17 00:00:00 2001 From: Xfjie314 <2075553664@qq.com> Date: Sun, 9 Nov 2025 23:04:18 +0800 Subject: [PATCH 1/6] Update create-plugin.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 对插件编写准备文档中文本不正确进行修改 --- .../version-2.4.4/tutorial/create-plugin.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/versioned_docs/version-2.4.4/tutorial/create-plugin.md b/website/versioned_docs/version-2.4.4/tutorial/create-plugin.md index 51a56faa923d..2f9b4feecb37 100644 --- a/website/versioned_docs/version-2.4.4/tutorial/create-plugin.md +++ b/website/versioned_docs/version-2.4.4/tutorial/create-plugin.md @@ -48,8 +48,10 @@ options: ```tree title=Project 📦 awesome-bot + ├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins + ├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` @@ -91,18 +93,20 @@ options: $ nb plugin create [?] 插件名称: weather [?] 使用嵌套插件? (y/N) N -[?] 输出目录: awesome_bot/plugins +[?] 请输入插件存储位置: awesome_bot/plugins ``` `nb-cli` 会在 `awesome_bot/plugins` 目录下创建一个名为 `weather` 的文件夹,其中包含的文件将在稍后章节中用到。 ```tree title=Project 📦 awesome-bot +├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins -| └── 📂 foo +| └── 📂 weather | ├── 📜 __init__.py | └── 📜 config.py +├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` From ad3fe0c4ff456ced9a4d58d09bcced3e45aa9d3c Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:05:16 +0800 Subject: [PATCH 2/6] sync --- website/docs/tutorial/create-plugin.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/website/docs/tutorial/create-plugin.md b/website/docs/tutorial/create-plugin.md index 51a56faa923d..2f9b4feecb37 100644 --- a/website/docs/tutorial/create-plugin.md +++ b/website/docs/tutorial/create-plugin.md @@ -48,8 +48,10 @@ options: ```tree title=Project 📦 awesome-bot + ├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins + ├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` @@ -91,18 +93,20 @@ options: $ nb plugin create [?] 插件名称: weather [?] 使用嵌套插件? (y/N) N -[?] 输出目录: awesome_bot/plugins +[?] 请输入插件存储位置: awesome_bot/plugins ``` `nb-cli` 会在 `awesome_bot/plugins` 目录下创建一个名为 `weather` 的文件夹,其中包含的文件将在稍后章节中用到。 ```tree title=Project 📦 awesome-bot +├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins -| └── 📂 foo +| └── 📂 weather | ├── 📜 __init__.py | └── 📜 config.py +├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` From 169473a6038186d0893b87d2f813be876faa8b39 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:06:05 +0800 Subject: [PATCH 3/6] sync --- .../version-2.4.3/tutorial/create-plugin.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md b/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md index 9ce4ed4dd797..2f9b4feecb37 100644 --- a/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md +++ b/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md @@ -48,8 +48,10 @@ options: ```tree title=Project 📦 awesome-bot + ├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins + ├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` @@ -64,7 +66,7 @@ options: ::: :::caution 注意 -如果在之前的[创建项目](./application.md)章节中手动创建了相关文件,那么你需要做出如下修改: +如果在之前的[创建项目](./application.mdx)章节中手动创建了相关文件,那么你需要做出如下修改: 1. 在项目目录中创建一个两层文件夹 `awesome_bot/plugins` @@ -91,18 +93,20 @@ options: $ nb plugin create [?] 插件名称: weather [?] 使用嵌套插件? (y/N) N -[?] 输出目录: awesome_bot/plugins +[?] 请输入插件存储位置: awesome_bot/plugins ``` `nb-cli` 会在 `awesome_bot/plugins` 目录下创建一个名为 `weather` 的文件夹,其中包含的文件将在稍后章节中用到。 ```tree title=Project 📦 awesome-bot +├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins -| └── 📂 foo +| └── 📂 weather | ├── 📜 __init__.py | └── 📜 config.py +├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` @@ -189,12 +193,16 @@ nonebot.load_from_json("plugin_config.json", encoding="utf-8") ### `load_from_toml` -通过 TOML 文件加载插件,是 [`load_all_plugins`](#load_all_plugins) 的 TOML 变种。通过读取 TOML 文件中的 `[tool.nonebot]` Table 中的 `plugins` 和 `plugin_dirs` Array 进行加载。例如: +通过 TOML 文件加载插件,是 [`load_all_plugins`](#load_all_plugins) 的 TOML 变种。通过读取 TOML 文件中的 `[tool.nonebot]` Table 中的 `plugin_dirs` Array 与 +`[tool.nonebot.plugins]` Table 中的多个 Array 进行加载。例如: ```toml title=plugin_config.toml [tool.nonebot] -plugins = ["path.to.your.plugin"] plugin_dirs = ["path/to/your/plugins"] + +[tool.nonebot.plugins] +"@local" = ["path.to.your.plugin"] # 本地插件等非插件商店来源的插件 +"nonebot-plugin-someplugin" = ["nonebot_plugin_someplugin"] # 插件商店来源的插件 ``` ```python From b061145e19773e196f5a8531e3ff02e990c1a83a Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:06:32 +0800 Subject: [PATCH 4/6] sync --- .../version-2.4.2/tutorial/create-plugin.md | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md b/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md index 9ce4ed4dd797..2f9b4feecb37 100644 --- a/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md +++ b/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md @@ -48,8 +48,10 @@ options: ```tree title=Project 📦 awesome-bot + ├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins + ├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` @@ -64,7 +66,7 @@ options: ::: :::caution 注意 -如果在之前的[创建项目](./application.md)章节中手动创建了相关文件,那么你需要做出如下修改: +如果在之前的[创建项目](./application.mdx)章节中手动创建了相关文件,那么你需要做出如下修改: 1. 在项目目录中创建一个两层文件夹 `awesome_bot/plugins` @@ -91,18 +93,20 @@ options: $ nb plugin create [?] 插件名称: weather [?] 使用嵌套插件? (y/N) N -[?] 输出目录: awesome_bot/plugins +[?] 请输入插件存储位置: awesome_bot/plugins ``` `nb-cli` 会在 `awesome_bot/plugins` 目录下创建一个名为 `weather` 的文件夹,其中包含的文件将在稍后章节中用到。 ```tree title=Project 📦 awesome-bot +├── 📂 .venv ├── 📂 awesome_bot │ └── 📂 plugins -| └── 📂 foo +| └── 📂 weather | ├── 📜 __init__.py | └── 📜 config.py +├── 📜 .env.prod ├── 📜 pyproject.toml └── 📜 README.md ``` @@ -189,12 +193,16 @@ nonebot.load_from_json("plugin_config.json", encoding="utf-8") ### `load_from_toml` -通过 TOML 文件加载插件,是 [`load_all_plugins`](#load_all_plugins) 的 TOML 变种。通过读取 TOML 文件中的 `[tool.nonebot]` Table 中的 `plugins` 和 `plugin_dirs` Array 进行加载。例如: +通过 TOML 文件加载插件,是 [`load_all_plugins`](#load_all_plugins) 的 TOML 变种。通过读取 TOML 文件中的 `[tool.nonebot]` Table 中的 `plugin_dirs` Array 与 +`[tool.nonebot.plugins]` Table 中的多个 Array 进行加载。例如: ```toml title=plugin_config.toml [tool.nonebot] -plugins = ["path.to.your.plugin"] plugin_dirs = ["path/to/your/plugins"] + +[tool.nonebot.plugins] +"@local" = ["path.to.your.plugin"] # 本地插件等非插件商店来源的插件 +"nonebot-plugin-someplugin" = ["nonebot_plugin_someplugin"] # 插件商店来源的插件 ``` ```python From 7e0f0ae876e28d8736883748ba86c8b7869ad184 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:08:18 +0800 Subject: [PATCH 5/6] fix --- website/versioned_docs/version-2.4.2/tutorial/create-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md b/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md index 2f9b4feecb37..135fbe3070ff 100644 --- a/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md +++ b/website/versioned_docs/version-2.4.2/tutorial/create-plugin.md @@ -66,7 +66,7 @@ options: ::: :::caution 注意 -如果在之前的[创建项目](./application.mdx)章节中手动创建了相关文件,那么你需要做出如下修改: +如果在之前的[创建项目](./application.md)章节中手动创建了相关文件,那么你需要做出如下修改: 1. 在项目目录中创建一个两层文件夹 `awesome_bot/plugins` From b65c9571d44c7fe628464c29306a092aac1aa403 Mon Sep 17 00:00:00 2001 From: Ju4tCode <42488585+yanyongyu@users.noreply.github.com> Date: Tue, 11 Nov 2025 00:09:03 +0800 Subject: [PATCH 6/6] fix --- website/versioned_docs/version-2.4.3/tutorial/create-plugin.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md b/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md index 2f9b4feecb37..135fbe3070ff 100644 --- a/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md +++ b/website/versioned_docs/version-2.4.3/tutorial/create-plugin.md @@ -66,7 +66,7 @@ options: ::: :::caution 注意 -如果在之前的[创建项目](./application.mdx)章节中手动创建了相关文件,那么你需要做出如下修改: +如果在之前的[创建项目](./application.md)章节中手动创建了相关文件,那么你需要做出如下修改: 1. 在项目目录中创建一个两层文件夹 `awesome_bot/plugins`