这是一个 nonebot2 插件项目的模板库, 你可以直接使用本模板创建你的 nonebot2 插件项目的仓库
模板库使用方法
[!NOTE] 模板库中自带了一个发布工作流, 你可以使用此工作流自动发布你的插件到 pypi
配置发布工作流
- 前往 https://pypi.org/manage/account/#api-tokens 并创建一个新的 API 令牌。创建成功后不要关闭页面,不然你将无法再次查看此令牌。
- 在单独的浏览器选项卡或窗口中,打开 Actions secrets and variables 页面。你也可以在 Settings - Secrets and variables - Actions 中找到此页面。
- 点击 New repository secret 按钮,创建一个名为
PYPI_API_TOKEN的新令牌,并从第一步复制粘贴令牌。
[!IMPORTANT] 这个发布工作流需要 pyproject.toml 文件, 并且只支持 PEP 621 标准的 pyproject.toml 文件
触发发布工作流
从本地推送任意 tag 即可触发。创建 tag:
git tag <tag_name>
推送本地所有 tag:
git push origin --tags
📖 介绍
这里是插件的详细介绍部分
💿 安装
使用 nb-cli 安装
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装nb plugin install nonebot-plugin-template
使用包管理器安装
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令pip
pip install nonebot-plugin-template
pdm
pdm add nonebot-plugin-template
poetry
poetry add nonebot-plugin-template
conda
conda install nonebot-plugin-template
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_template"]
⚙️ 配置
在 nonebot2 项目的.env文件中添加下表中的必填配置
| 配置项 | 必填 | 默认值 | 说明 |
|---|---|---|---|
| 配置项1 | 是 | 无 | 配置说明 |
| 配置项2 | 否 | 无 | 配置说明 |
🎉 使用
指令表
| 指令 | 权限 | 需要@ | 范围 | 说明 |
|---|---|---|---|---|
| 指令1 | 主人 | 否 | 私聊 | 指令说明 |
| 指令2 | 群员 | 是 | 群聊 | 指令说明 |
效果图
如果有效果图的话
Metadata
Release files for nonebot-plugin-github-webhook 0.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| nonebot_plugin_github_webhook-0.0.0.tar.gz | 8.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| nonebot_plugin_github_webhook-0.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 21.4 kB
Release files / nonebot_plugin_github_webhook-0.0.0.tar.gz
| Download URL | nonebot_plugin_github_webhook-0.0.0.tar.gz |
|---|---|
| Size | 8.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
279274af5903cad64aed08e874fcf0486224910d13eaa03cd1d07a4593bb842d
|
|
BLAKE2b-256 checksum How to use checksums |
b19d7e85f59c19cf01cbfd3fdd08ac25b70fee2e11a0a7f8a095a955a450cc98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.13.3 Darwin/24.4.0
|
Release files / nonebot_plugin_github_webhook-0.0.0-py3-none-any.whl
| Download URL | nonebot_plugin_github_webhook-0.0.0-py3-none-any.whl |
|---|---|
| Size | 12.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
2bf8f462ee6f10882cfff66739d78367eedab192d0d109721bda37a5bb790019
|
|
BLAKE2b-256 checksum How to use checksums |
90590419ad48df4ed3e53ef0defa27d06ab3214a21b58056562c6567f6f6f114
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/2.1.2 CPython/3.13.3 Darwin/24.4.0
|