Skip to content

Commit bca7e51

Browse files
🎉 Initialize repository with correct naming
1 parent 3dd93bf commit bca7e51

File tree

6 files changed

+64
-170
lines changed

6 files changed

+64
-170
lines changed

README.md

Lines changed: 56 additions & 60 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22
<a href="https://v2.nonebot.dev/store">
33
<img src="https://raw.githubusercontent.com/fllesser/nonebot-plugin-template/refs/heads/resource/.docs/NoneBotPlugin.svg" width="310" alt="logo"></a>
44

5-
## ✨ nonebot-plugin-template
5+
## ✨ nonebot-plugin-nyaturingtest
66

7+
<a href="./LICENSE">
8+
<img src="https://img.shields.io/github/license/shadow3aaa/nonebot-plugin-nyaturingtest.svg" alt="license">
9+
</a>
10+
<a href="https://pypi.python.org/pypi/nonebot-plugin-nyaturingtest">
11+
<img src="https://img.shields.io/pypi/v/nonebot-plugin-nyaturingtest.svg" alt="pypi">
12+
</a>
713
<img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="python">
814
<a href="https://github.com/astral-sh/ruff">
915
<img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json" alt="ruff">
@@ -14,93 +20,83 @@
1420
</div>
1521

1622
> [!IMPORTANT]
17-
> **收藏项目** 方便下次创建插件仓库~⭐️
18-
19-
<img width="100%" src="https://starify.komoridevs.icu/api/starify?owner=fllesser&repo=nonebot-plugin-template" alt="starify" />
20-
21-
### 🎉 快速开始
22-
23-
1. 点击 [创建仓库](https://github.com/new?template_owner=fllesser&template_name=nonebot-plugin-template&owner=%40me&name=nonebot-plugin-&visibility=public)
24-
2. **⚠️ 重要:** 前往仓库 `Settings` -> `Actions` -> `General` -> 最下方 `Workflow permissions`, 勾选 `Read and write permissions`,然后点击 `Save` 按钮
25-
3.`Add file` 菜单中选择 `Create new file`, 在新文件名处输入`LICENSE`, 此时在右侧会出现一个 `Choose a license template` 按钮, 点击此按钮选择开源协议模板, 然后在最下方提交新文件到主分支(这会触发一个工作流,生成新的 `README`,并修改 `pyproject.toml` 等文件中的插件名称)
23+
> **收藏项目** ~⭐️
2624
27-
> [!NOTE]
28-
> 模板库中自带了一个发布工作流, 你可以使用此工作流自动发布你的插件到 pypi
25+
<img width="100%" src="https://starify.komoridevs.icu/api/starify?owner=shadow3aaa&repo=nonebot-plugin-nyaturingtest" alt="starify" />
2926

30-
<details>
31-
<summary>配置发布工作流</summary>
3227

33-
1. 前往 https://pypi.org/manage/account/#api-tokens 并创建一个新的 API 令牌。创建成功后不要关闭页面,不然你将无法再次查看此令牌。
34-
2. 在单独的浏览器选项卡或窗口中,打开 [Actions secrets and variables](./settings/secrets/actions) 页面。你也可以在 Settings - Secrets and variables - Actions 中找到此页面。
35-
3. 点击 New repository secret 按钮,创建一个名为 `PYPI_API_TOKEN` 的新令牌,并从第一步复制粘贴令牌。
28+
## 📖 介绍
3629

37-
</details>
30+
这里是插件的详细介绍部分
3831

39-
<details>
40-
<summary>触发发布工作流</summary>
32+
## 💿 安装
4133

42-
从本地推送任意 `tag` 即可触发。
34+
<details open>
35+
<summary>使用 nb-cli 安装</summary>
36+
在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装
4337

44-
创建 `tag`:
38+
nb plugin install nonebot-plugin-nyaturingtest --upgrade
39+
使用 **pypi** 源安装
4540

46-
git tag v*
41+
nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.org/simple"
42+
使用**清华源**安装
4743

48-
推送本地所有 `tag`:
44+
nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple"
4945

50-
git push origin --tags
5146

5247
</details>
5348

54-
> [!IMPORTANT]
55-
> 不会使用 uv ?
56-
5749
<details>
58-
<summary>不会看文档去</summary>
50+
<summary>使用包管理器安装</summary>
51+
在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令
5952

60-
<details>
61-
<summary>安装 uv </summary>
62-
63-
`windows`:
64-
65-
powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
66-
`curl`:
53+
<details open>
54+
<summary>uv</summary>
6755

68-
curl -LsSf https://astral.sh/uv/install.sh | sh
69-
`pipx`:
56+
uv add nonebot-plugin-nyaturingtest
57+
安装仓库 master 分支
7058

71-
pipx install uv
72-
59+
uv add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
7360
</details>
7461

75-
安装所有依赖(自动创建 `venv` 虚拟环境, `-p` 指定 `python` 版本):
62+
<details>
63+
<summary>pdm</summary>
7664

77-
uv sync --all-groups -p 3.12
78-
添加其他依赖, 例如 `koishi`(bushi
65+
pdm add nonebot-plugin-nyaturingtest
66+
安装仓库 master 分支
7967

80-
uv add koishi
81-
[uv 文档](https://astral.sh/blog/uv)
68+
pdm add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
8269
</details>
70+
<details>
71+
<summary>poetry</summary>
8372

84-
> [!NOTE]
85-
> pre-commit 使用方法
73+
poetry add nonebot-plugin-nyaturingtest
74+
安装仓库 master 分支
8675

87-
<details>
88-
<summary>使用 nonemoji 为 commit message 添加 emoji 前缀 </summary>
76+
poetry add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master
77+
</details>
8978

90-
安装 `nonemoji`
79+
打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入
9180

92-
pipx install nonemoji
93-
安装 `pre-commit`
81+
plugins = ["nonebot_plugin_nyaturingtest"]
9482

95-
pipx install pre-commit
83+
</details>
9684

97-
pre-commit install
98-
添加到暂存区
85+
## ⚙️ 配置
9986

100-
git add <待提交文件>
101-
使用 `nonemoji` 编辑 `commit message`**提交**
87+
在 nonebot2 项目的`.env`文件中添加下表中的必填配置
10288

103-
nonemoji
89+
| 配置项 | 必填 | 默认值 | 说明 |
90+
| :-----: | :---: | :----: | :------: |
91+
| 配置项1 ||| 配置说明 |
92+
| 配置项2 ||| 配置说明 |
10493

105-
仓库地址: [nonemoji](https://github.com/nonebot/nonemoji)
106-
</details>
94+
## 🎉 使用
95+
### 指令表
96+
| 指令 | 权限 | 需要@ | 范围 | 说明 |
97+
| :---: | :---: | :---: | :---: | :------: |
98+
| 指令1 | 主人 || 私聊 | 指令说明 |
99+
| 指令2 | 群员 || 群聊 | 指令说明 |
100+
101+
### 🎨 效果图
102+
如果有效果图的话

pyproject.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[project]
2-
name = "nonebot-plugin-template"
2+
name = "nonebot-plugin-nyaturingtest"
33
version = "0.1.0"
44
description = "插件描述"
55
readme = "README.md"
6-
authors = [{ name = "owner", email = "owner@gmail.com" }]
7-
urls = { Repository = "https://github.com/owner/nonebot-plugin-template" }
6+
authors = [{ name = "shadow3aaa", email = "shadow3aaa@gmail.com" }]
7+
urls = { Repository = "https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest" }
88
requires-python = ">=3.10,<3.13"
99
dependencies = [
1010
"nonebot2>=2.4.2,<3.0.0",

readme_template.md

Lines changed: 0 additions & 102 deletions
This file was deleted.

src/nonebot_plugin_template/__init__.py renamed to src/nonebot_plugin_nyaturingtest/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@
1313
description="描述",
1414
usage="用法",
1515
type="application", # library
16-
homepage="https://github.com/owner/nonebot-plugin-template",
16+
homepage="https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest",
1717
config=Config,
1818
supported_adapters=inherit_supported_adapters("nonebot_plugin_alconna", "nonebot_plugin_uninfo"),
1919
# supported_adapters={"~onebot.v11"}, # 仅 onebot 应取消注释
20-
extra={"author": "owner <[email protected]>"},
20+
extra={"author": "shadow3aaa <[email protected]>"},
2121
)
2222

2323
from arclet.alconna import Alconna, Args, Arparma, Option, Subcommand
File renamed without changes.

tests/plugin_test.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@ async def test_pip(app: App):
3232
from nonebot import require
3333
from nonebot.adapters.onebot.v11 import Adapter as OnebotV11Adapter
3434

35-
assert require("nonebot_plugin_template")
35+
assert require("nonebot_plugin_nyaturingtest")
3636

3737
event = make_onebot_msg(Message("pip install nonebot2"))
3838
try:
39-
from nonebot_plugin_template import pip
39+
from nonebot_plugin_nyaturingtest import pip
4040
except ImportError:
41-
pytest.skip("nonebot_plugin_template.pip not found")
41+
pytest.skip("nonebot_plugin_nyaturingtest.pip not found")
4242

4343
async with app.test_matcher(pip) as ctx:
4444
adapter = nonebot.get_adapter(OnebotV11Adapter)

0 commit comments

Comments
 (0)