Nonebot2 插件:群工具
Project description
这是一个使用 PDM 作为包管理器的 nonebot2 插件项目的模板库, 你可以直接使用本模板创建你的 nonebot2 插件项目的仓库
模板库使用方法
-
点击仓库中的 "Use this template" 按钮, 输入仓库名与描述, 点击 " Create repository from template" 创建仓库
-
在创建好的新仓库中, 在 "Add file" 菜单中选择 "Create new file", 在新文件名处输入
LICENSE, 此时在右侧会出现一个 "Choose a license template" 按钮, 点击此按钮选择开源协议模板, 然后在最下方提交新文件到主分支 -
本地机器首先需要安装 git, python 3.9+ 和 pdm 2.13+
-
克隆你刚刚创建的仓库到本地, 并进入仓库目录, 执行
pdm sync安装虚拟环境与依赖 -
利用编辑器打开仓库目录, 执行以下全局替换操作:
- 全局替换
nonebot-plugin-template为你插件的包名 (用于 pip 安装等) - 全局替换
nonebot_plugin_template为你插件的包名 (用于 python 导入等) - 全局替换
<your_plugin_humanized_name>为你插件的可读名 (用于插件商店 等) - 全局替换
<your_plugin_description>为你插件的简单描述 - 全局替换
<your_github>为你的 github 用户名 - 全局替换
<your_email>为你的邮箱
- 全局替换
-
修改 README 中的插件名和插件描述, 并在下方填充相应的内容
配置发布工作流
模块库中自带了一个发布工作流, 你可以使用此工作流自动发布你的插件到 pypi
- 前往 https://pypi.org/ 并注册一个账号。
- 前往 https://pypi.org/manage/account/publishing/, 下翻到
Pending publishers - 选择
Github选项栏,填写相关信息:- PyPI Project Name: 你的插件包名,如
nonebot-plugin-template - Owner: 你的 Github 用户名
- Repository name: 你的插件仓库名称,如
nonebot-plugin-template - Workflow name: 请填入
release.yml
- PyPI Project Name: 你的插件包名,如
- 点击
Add按钮,完成发布工作流配置
触发发布工作流
- 任意提交后,在 Github 仓库界面点击
Releases选项,点击Create a new release按钮。若没有Release选项,可在仓库主页点击Tags选项,在新界面点击Create a new release按钮 - 点击
Choose a tag,输入以v开头的版本号,如v0.0.1,然后点击Create new tag按钮 - 填写
Release title和Describe this release。或点击Generate release notes自动生成相关信息 - 点击
Publish release按钮,触发发布工作流
介绍
这里是插件的详细介绍部分
安装方法
使用 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
打开 nonebot2 项目根目录下的 pyproject.toml 文件, 在 [tool.nonebot] 部分追加写入
plugins = ["nonebot_plugin_template"]
...
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nonebot_plugin_funticon-0.1.0.tar.gz.
File metadata
- Download URL: nonebot_plugin_funticon-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.6 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2c82cdb7af2137bee7201f9e629955b5ac17d801e35eee13debfa133b041f3a
|
|
| MD5 |
183fa92ddcb1dfbf4840437ca6b6c9d5
|
|
| BLAKE2b-256 |
6908a21dcedb6cf656eb00daf6b6eb8f9370afb8e6541033c0d97bc1f2fd48fc
|
File details
Details for the file nonebot_plugin_funticon-0.1.0-py3-none-any.whl.
File metadata
- Download URL: nonebot_plugin_funticon-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.6 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6b39533f99c67f7cf7ae069e5737b72f5c577b415463a4fef1c7d2027fc2b7f8
|
|
| MD5 |
f8e8b74c6c9ad390533ea3e78c9d0de8
|
|
| BLAKE2b-256 |
e4fcbb95b820bf56cf18a7c9c615d51f06af4c349c578d5115e484d8df2afdcd
|