|
2 | 2 | <a href="https://v2.nonebot.dev/store"> |
3 | 3 | <img src="https://raw.githubusercontent.com/fllesser/nonebot-plugin-template/refs/heads/resource/.docs/NoneBotPlugin.svg" width="310" alt="logo"></a> |
4 | 4 |
|
5 | | -## ✨ nonebot-plugin-template ✨ |
| 5 | +## ✨ nonebot-plugin-nyaturingtest ✨ |
6 | 6 |
|
| 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> |
7 | 13 | <img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="python"> |
8 | 14 | <a href="https://github.com/astral-sh/ruff"> |
9 | 15 | <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json" alt="ruff"> |
|
14 | 20 | </div> |
15 | 21 |
|
16 | 22 | > [!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 | +> **收藏项目** ~⭐️ |
26 | 24 |
|
27 | | -> [!NOTE] |
28 | | -> 模板库中自带了一个发布工作流, 你可以使用此工作流自动发布你的插件到 pypi |
| 25 | +<img width="100%" src="https://starify.komoridevs.icu/api/starify?owner=shadow3aaa&repo=nonebot-plugin-nyaturingtest" alt="starify" /> |
29 | 26 |
|
30 | | -<details> |
31 | | -<summary>配置发布工作流</summary> |
32 | 27 |
|
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 | +## 📖 介绍 |
36 | 29 |
|
37 | | -</details> |
| 30 | +这里是插件的详细介绍部分 |
38 | 31 |
|
39 | | -<details> |
40 | | -<summary>触发发布工作流</summary> |
| 32 | +## 💿 安装 |
41 | 33 |
|
42 | | -从本地推送任意 `tag` 即可触发。 |
| 34 | +<details open> |
| 35 | +<summary>使用 nb-cli 安装</summary> |
| 36 | +在 nonebot2 项目的根目录下打开命令行, 输入以下指令即可安装 |
43 | 37 |
|
44 | | -创建 `tag`: |
| 38 | + nb plugin install nonebot-plugin-nyaturingtest --upgrade |
| 39 | +使用 **pypi** 源安装 |
45 | 40 |
|
46 | | - git tag v* |
| 41 | + nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.org/simple" |
| 42 | +使用**清华源**安装 |
47 | 43 |
|
48 | | -推送本地所有 `tag`: |
| 44 | + nb plugin install nonebot-plugin-nyaturingtest --upgrade -i "https://pypi.tuna.tsinghua.edu.cn/simple" |
49 | 45 |
|
50 | | - git push origin --tags |
51 | 46 |
|
52 | 47 | </details> |
53 | 48 |
|
54 | | -> [!IMPORTANT] |
55 | | -> 不会使用 uv ? |
56 | | -
|
57 | 49 | <details> |
58 | | -<summary>不会看文档去</summary> |
| 50 | +<summary>使用包管理器安装</summary> |
| 51 | +在 nonebot2 项目的插件目录下, 打开命令行, 根据你使用的包管理器, 输入相应的安装命令 |
59 | 52 |
|
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> |
67 | 55 |
|
68 | | - curl -LsSf https://astral.sh/uv/install.sh | sh |
69 | | -`pipx`: |
| 56 | + uv add nonebot-plugin-nyaturingtest |
| 57 | +安装仓库 master 分支 |
70 | 58 |
|
71 | | - pipx install uv |
72 | | - |
| 59 | + uv add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master |
73 | 60 | </details> |
74 | 61 |
|
75 | | -安装所有依赖(自动创建 `venv` 虚拟环境, `-p` 指定 `python` 版本): |
| 62 | +<details> |
| 63 | +<summary>pdm</summary> |
76 | 64 |
|
77 | | - uv sync --all-groups -p 3.12 |
78 | | -添加其他依赖, 例如 `koishi`(bushi |
| 65 | + pdm add nonebot-plugin-nyaturingtest |
| 66 | +安装仓库 master 分支 |
79 | 67 |
|
80 | | - uv add koishi |
81 | | -[uv 文档](https://astral.sh/blog/uv) |
| 68 | + pdm add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master |
82 | 69 | </details> |
| 70 | +<details> |
| 71 | +<summary>poetry</summary> |
83 | 72 |
|
84 | | -> [!NOTE] |
85 | | -> pre-commit 使用方法 |
| 73 | + poetry add nonebot-plugin-nyaturingtest |
| 74 | +安装仓库 master 分支 |
86 | 75 |
|
87 | | -<details> |
88 | | -<summary>使用 nonemoji 为 commit message 添加 emoji 前缀 </summary> |
| 76 | + poetry add git+https://github.com/shadow3aaa/nonebot-plugin-nyaturingtest@master |
| 77 | +</details> |
89 | 78 |
|
90 | | -安装 `nonemoji` |
| 79 | +打开 nonebot2 项目根目录下的 `pyproject.toml` 文件, 在 `[tool.nonebot]` 部分追加写入 |
91 | 80 |
|
92 | | - pipx install nonemoji |
93 | | -安装 `pre-commit` |
| 81 | + plugins = ["nonebot_plugin_nyaturingtest"] |
94 | 82 |
|
95 | | - pipx install pre-commit |
| 83 | +</details> |
96 | 84 |
|
97 | | - pre-commit install |
98 | | -添加到暂存区 |
| 85 | +## ⚙️ 配置 |
99 | 86 |
|
100 | | - git add <待提交文件> |
101 | | -使用 `nonemoji` 编辑 `commit message` 并**提交** |
| 87 | +在 nonebot2 项目的`.env`文件中添加下表中的必填配置 |
102 | 88 |
|
103 | | - nonemoji |
| 89 | +| 配置项 | 必填 | 默认值 | 说明 | |
| 90 | +| :-----: | :---: | :----: | :------: | |
| 91 | +| 配置项1 | 是 | 无 | 配置说明 | |
| 92 | +| 配置项2 | 否 | 无 | 配置说明 | |
104 | 93 |
|
105 | | -仓库地址: [nonemoji](https://github.com/nonebot/nonemoji) |
106 | | -</details> |
| 94 | +## 🎉 使用 |
| 95 | +### 指令表 |
| 96 | +| 指令 | 权限 | 需要@ | 范围 | 说明 | |
| 97 | +| :---: | :---: | :---: | :---: | :------: | |
| 98 | +| 指令1 | 主人 | 否 | 私聊 | 指令说明 | |
| 99 | +| 指令2 | 群员 | 是 | 群聊 | 指令说明 | |
| 100 | + |
| 101 | +### 🎨 效果图 |
| 102 | +如果有效果图的话 |
0 commit comments