nonebot-plugin-bawiki-revive 0.0.1__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. nonebot_plugin_bawiki_revive-0.0.1/.github/FUNDING.yml +3 -0
  2. nonebot_plugin_bawiki_revive-0.0.1/.github/workflows/pypi-publish.yml +34 -0
  3. nonebot_plugin_bawiki_revive-0.0.1/.gitignore +176 -0
  4. nonebot_plugin_bawiki_revive-0.0.1/AGENTS.md +23 -0
  5. nonebot_plugin_bawiki_revive-0.0.1/LICENSE +21 -0
  6. nonebot_plugin_bawiki_revive-0.0.1/PKG-INFO +229 -0
  7. nonebot_plugin_bawiki_revive-0.0.1/README.md +207 -0
  8. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/__init__.py +44 -0
  9. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/commands/__init__.py +7 -0
  10. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/commands/arona.py +205 -0
  11. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/config.py +26 -0
  12. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/__init__.py +0 -0
  13. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/arona/__init__.py +19 -0
  14. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/arona/alias.py +47 -0
  15. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/arona/client.py +74 -0
  16. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/arona/consts.py +4 -0
  17. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/arona/models.py +41 -0
  18. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/data_source/request.py +43 -0
  19. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/legacy_migration.py +22 -0
  20. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/__init__.py +194 -0
  21. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/base.html.jinja +48 -0
  22. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/css/base.css +373 -0
  23. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/css/detail.css +535 -0
  24. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/css/index.css +279 -0
  25. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/detail.html.jinja +195 -0
  26. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/fonts/font.otf +0 -0
  27. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/pmn/res/index.html.jinja +88 -0
  28. nonebot_plugin_bawiki_revive-0.0.1/nonebot_plugin_bawiki_revive/utils.py +29 -0
  29. nonebot_plugin_bawiki_revive-0.0.1/pyproject.toml +43 -0
  30. nonebot_plugin_bawiki_revive-0.0.1/tests/__init__.py +1 -0
  31. nonebot_plugin_bawiki_revive-0.0.1/tests/conftest.py +52 -0
  32. nonebot_plugin_bawiki_revive-0.0.1/tests/test_arona.py +818 -0
@@ -0,0 +1,3 @@
1
+ custom:
2
+ - https://afdian.net/a/lgc2333/
3
+ - https://blog.lgc2333.top/donate
@@ -0,0 +1,34 @@
1
+ name: Publish Python 🐍 distributions 📦 to PyPI
2
+
3
+ on:
4
+ release:
5
+ types: [published]
6
+ workflow_dispatch:
7
+
8
+ jobs:
9
+ build-n-publish:
10
+ name: Use uv to Build and publish Python 🐍 distributions 📦 to PyPI
11
+ runs-on: ubuntu-latest
12
+
13
+ permissions:
14
+ # IMPORTANT: this permission is mandatory for trusted publishing
15
+ id-token: write
16
+
17
+ steps:
18
+ - name: Checkout
19
+ uses: actions/checkout@master
20
+ with:
21
+ submodules: true
22
+
23
+ - name: Install uv
24
+ uses: astral-sh/setup-uv@v5
25
+
26
+ - name: 'Set up Python'
27
+ uses: actions/setup-python@v5
28
+ with:
29
+ python-version-file: 'pyproject.toml'
30
+
31
+ - name: Build and Publish distribution 📦 to PyPI
32
+ run: |
33
+ uv build
34
+ uv publish
@@ -0,0 +1,176 @@
1
+ # Created by https://www.toptal.com/developers/gitignore/api/python
2
+ # Edit at https://www.toptal.com/developers/gitignore?templates=python
3
+
4
+ ### Python ###
5
+ # Byte-compiled / optimized / DLL files
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+
10
+ # C extensions
11
+ *.so
12
+
13
+ # Distribution / packaging
14
+ .Python
15
+ build/
16
+ develop-eggs/
17
+ dist/
18
+ downloads/
19
+ eggs/
20
+ .eggs/
21
+ lib/
22
+ lib64/
23
+ parts/
24
+ sdist/
25
+ var/
26
+ wheels/
27
+ share/python-wheels/
28
+ *.egg-info/
29
+ .installed.cfg
30
+ *.egg
31
+ MANIFEST
32
+
33
+ # PyInstaller
34
+ # Usually these files are written by a python script from a template
35
+ # before PyInstaller builds the exe, so as to inject date/other infos into it.
36
+ *.manifest
37
+ *.spec
38
+
39
+ # Installer logs
40
+ pip-log.txt
41
+ pip-delete-this-directory.txt
42
+
43
+ # Unit test / coverage reports
44
+ htmlcov/
45
+ .tox/
46
+ .nox/
47
+ .coverage
48
+ .coverage.*
49
+ .cache
50
+ nosetests.xml
51
+ coverage.xml
52
+ *.cover
53
+ *.py,cover
54
+ .hypothesis/
55
+ .pytest_cache/
56
+ cover/
57
+
58
+ # Translations
59
+ *.mo
60
+ *.pot
61
+
62
+ # Django stuff:
63
+ *.log
64
+ local_settings.py
65
+ db.sqlite3
66
+ db.sqlite3-journal
67
+
68
+ # Flask stuff:
69
+ instance/
70
+ .webassets-cache
71
+
72
+ # Scrapy stuff:
73
+ .scrapy
74
+
75
+ # Sphinx documentation
76
+ docs/_build/
77
+
78
+ # PyBuilder
79
+ .pybuilder/
80
+ target/
81
+
82
+ # Jupyter Notebook
83
+ .ipynb_checkpoints
84
+
85
+ # IPython
86
+ profile_default/
87
+ ipython_config.py
88
+
89
+ # pyenv
90
+ # For a library or package, you might want to ignore these files since the code is
91
+ # intended to run in multiple environments; otherwise, check them in:
92
+ .python-version
93
+
94
+ # pipenv
95
+ # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
96
+ # However, in case of collaboration, if having platform-specific dependencies or dependencies
97
+ # having no cross-platform support, pipenv may install dependencies that don't work, or not
98
+ # install all needed dependencies.
99
+ Pipfile.lock
100
+
101
+ # poetry
102
+ # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
103
+ # This is especially recommended for binary packages to ensure reproducibility, and is more
104
+ # commonly ignored for libraries.
105
+ # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
106
+ poetry.lock
107
+
108
+ # pdm
109
+ # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
110
+ # pdm.lock
111
+ # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
112
+ # in version control.
113
+ # https://pdm.fming.dev/#use-with-ide
114
+ .pdm.toml
115
+
116
+ # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
117
+ __pypackages__/
118
+
119
+ # Celery stuff
120
+ celerybeat-schedule
121
+ celerybeat.pid
122
+
123
+ # SageMath parsed files
124
+ *.sage.py
125
+
126
+ # Environments
127
+ .env
128
+ .venv
129
+ env/
130
+ venv/
131
+ ENV/
132
+ env.bak/
133
+ venv.bak/
134
+
135
+ # Spyder project settings
136
+ .spyderproject
137
+ .spyproject
138
+
139
+ # Rope project settings
140
+ .ropeproject
141
+
142
+ # mkdocs documentation
143
+ /site
144
+
145
+ # mypy
146
+ .mypy_cache/
147
+ .dmypy.json
148
+ dmypy.json
149
+
150
+ # Pyre type checker
151
+ .pyre/
152
+
153
+ # pytype static type analyzer
154
+ .pytype/
155
+
156
+ # Cython debug symbols
157
+ cython_debug/
158
+
159
+ # PyCharm
160
+ # JetBrains specific template is maintained in a separate JetBrains.gitignore that can
161
+ # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
162
+ # and can be added to the global gitignore or merged into this file. For a more nuclear
163
+ # option (not recommended) you can uncomment the following to ignore the entire idea folder.
164
+ #.idea/
165
+
166
+ ### Python Patch ###
167
+ # Poetry local configuration file - https://python-poetry.org/docs/configuration/#local-configuration
168
+ poetry.toml
169
+
170
+ # ruff
171
+ .ruff_cache/
172
+
173
+ # LSP config files
174
+ pyrightconfig.json
175
+
176
+ # End of https://www.toptal.com/developers/gitignore/api/python
@@ -0,0 +1,23 @@
1
+ # AGENTS.md
2
+
3
+ First: This project expects the working root to be github repo `lgc-NB2Dev/workspace` because some recommended workspace-level files is not stored in this plugin project. If you are not working from that root, stop and notify the user.
4
+
5
+ ## Commands
6
+
7
+ NOTE: The following command are expected to be run under the plugin repo root rather than the workspace root.
8
+
9
+ ```bash
10
+ uv run pytest
11
+ ```
12
+
13
+ ## Structure
14
+
15
+ To be added
16
+
17
+ ## Rules
18
+
19
+ - Keep test coverage as high as possible to avoid dead code. Code included in the current runtime's coverage scope should be covered unless it is version-specific, dependency-gated, or an intentional error path that is impractical to trigger safely.
20
+
21
+ ## Gotchas
22
+
23
+ Currently empty
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2023 LgCuwukii
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,229 @@
1
+ Metadata-Version: 2.4
2
+ Name: nonebot-plugin-bawiki-revive
3
+ Version: 0.0.1
4
+ Summary: BAWiki Revive
5
+ Project-URL: homepage, https://github.com/lgc-NB2Dev/nonebot-plugin-bawiki-revive
6
+ Author-email: LgCuwukii <lgc2333@126.com>
7
+ License: MIT
8
+ License-File: LICENSE
9
+ Requires-Python: <4.0,>=3.10
10
+ Requires-Dist: cookit[nonebot-localstore,pyd]>=0.13.3
11
+ Requires-Dist: httpx>=0.28.1
12
+ Requires-Dist: nonebot-plugin-alconna>=0.62.0
13
+ Requires-Dist: nonebot-plugin-localstore>=0.7.4
14
+ Requires-Dist: nonebot-plugin-waiter>=0.8.1
15
+ Requires-Dist: nonebot2>=2.5.0
16
+ Requires-Dist: tenacity>=9.1.4
17
+ Provides-Extra: all
18
+ Requires-Dist: nonebot-plugin-picmenu-next>=0.4.0; extra == 'all'
19
+ Provides-Extra: menu
20
+ Requires-Dist: nonebot-plugin-picmenu-next>=0.4.0; extra == 'menu'
21
+ Description-Content-Type: text/markdown
22
+
23
+ <!-- markdownlint-disable MD031 MD033 MD036 MD041 -->
24
+
25
+ <div align="center">
26
+
27
+ <a href="https://v2.nonebot.dev/store">
28
+ <img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo">
29
+ </a>
30
+
31
+ <p>
32
+ <img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
33
+ </p>
34
+
35
+ # NoneBot-Plugin-BAWiki-Revive
36
+
37
+ _✨ 蔚蓝档案综合插件,堂堂复活(并没完全复活) ✨_
38
+
39
+ <img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="python">
40
+ <a href="https://github.com/astral-sh/uv">
41
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
42
+ </a>
43
+ <a href="https://wakatime.com/badge/user/b61b0f9a-f40b-4c82-bc51-0a75c67bfccf/project/f4778875-45a4-4688-8e1b-b8c844440abb">
44
+ <img src="https://wakatime.com/badge/user/b61b0f9a-f40b-4c82-bc51-0a75c67bfccf/project/f4778875-45a4-4688-8e1b-b8c844440abb.svg" alt="wakatime">
45
+ </a>
46
+
47
+ <br />
48
+
49
+ <a href="https://pydantic.dev">
50
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/pyd-v1-or-v2.json" alt="Pydantic Version 1 Or 2" >
51
+ </a>
52
+ <a href="./LICENSE">
53
+ <img src="https://img.shields.io/github/license/lgc-NB2Dev/nonebot-plugin-bawiki-revive.svg" alt="license">
54
+ </a>
55
+ <a href="https://pypi.python.org/pypi/nonebot-plugin-bawiki-revive">
56
+ <img src="https://img.shields.io/pypi/v/nonebot-plugin-bawiki-revive.svg" alt="pypi">
57
+ </a>
58
+ <a href="https://pypi.python.org/pypi/nonebot-plugin-bawiki-revive">
59
+ <img src="https://img.shields.io/pypi/dm/nonebot-plugin-bawiki-revive" alt="pypi download">
60
+ </a>
61
+
62
+ <br />
63
+
64
+ <a href="https://registry.nonebot.dev/plugin/nonebot-plugin-bawiki-revive:nonebot_plugin_bawiki_revive">
65
+ <img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fnbbdg.lgc2333.top%2Fplugin%2Fnonebot-plugin-bawiki-revive" alt="NoneBot Registry">
66
+ </a>
67
+ <a href="https://registry.nonebot.dev/plugin/nonebot-plugin-bawiki-revive:nonebot_plugin_bawiki_revive">
68
+ <img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fnbbdg.lgc2333.top%2Fplugin-adapters%2Fnonebot-plugin-bawiki-revive" alt="Supported Adapters">
69
+ </a>
70
+
71
+ </div>
72
+
73
+ ## 📖 介绍
74
+
75
+ 什么?BAWiki 复活了(但是好像并没有完全活)
76
+
77
+ 当前版本主要提供 Arona 攻略数据源查询功能。
78
+
79
+ ## 💿 安装
80
+
81
+ 以下提到的方法 任选**其一** 即可
82
+
83
+ <details open>
84
+ <summary>[推荐] 使用 nb-cli 安装</summary>
85
+ 在 nonebot2 项目的根目录下打开命令行,输入以下指令即可安装
86
+
87
+ ```bash
88
+ nb plugin install nonebot-plugin-bawiki-revive
89
+ ```
90
+
91
+ </details>
92
+
93
+ <details>
94
+ <summary>使用包管理器安装</summary>
95
+ 在 nonebot2 项目的插件目录下,打开命令行,根据你使用的包管理器,输入相应的安装命令
96
+
97
+ <details>
98
+ <summary>pip</summary>
99
+
100
+ ```bash
101
+ pip install nonebot-plugin-bawiki-revive
102
+ ```
103
+
104
+ </details>
105
+ <details>
106
+ <summary>pdm</summary>
107
+
108
+ ```bash
109
+ pdm add nonebot-plugin-bawiki-revive
110
+ ```
111
+
112
+ </details>
113
+ <details>
114
+ <summary>poetry</summary>
115
+
116
+ ```bash
117
+ poetry add nonebot-plugin-bawiki-revive
118
+ ```
119
+
120
+ </details>
121
+ <details>
122
+ <summary>conda</summary>
123
+
124
+ ```bash
125
+ conda install nonebot-plugin-bawiki-revive
126
+ ```
127
+
128
+ </details>
129
+
130
+ 打开 nonebot2 项目根目录下的 `pyproject.toml` 文件,在 `[tool.nonebot]` 部分的 `plugins` 项里追加写入
131
+
132
+ ```toml
133
+ [tool.nonebot]
134
+ plugins = [
135
+ # ...
136
+ "nonebot_plugin_bawiki_revive"
137
+ ]
138
+ ```
139
+
140
+ </details>
141
+
142
+ ## ⚙️ 配置
143
+
144
+ 在 NoneBot2 项目的 `.env` 文件中添加下表中的配置
145
+
146
+ | 配置项 | 必填 | 默认值 | 说明 |
147
+ | :-------------------------------------: | :--: | :-----: | :------------------------------------------: |
148
+ | **通用配置** | | | |
149
+ | `BAWIKI_REV_REQUEST_TIMEOUT` | 否 | `10.0` | 请求超时时间(秒) |
150
+ | `BAWIKI_REV_REQUEST_RETRY_ATTEMPTS` | 否 | `3` | 请求失败重试次数 |
151
+ | `BAWIKI_REV_REQUEST_RETRY_WAIT` | 否 | `1.0` | 每次请求重试前等待时间 |
152
+ | **Arona 配置** | | | |
153
+ | `BAWIKI_REV_ARONA_API_BASE_URL` | 否 | ... | Arona API 基地址 |
154
+ | `BAWIKI_REV_ARONA_CDN_BASE_URL` | 否 | ... | Arona 图片 CDN 基地址 |
155
+ | `BAWIKI_REV_ARONA_SEARCH_SIZE` | 否 | `8` | 模糊搜索返回结果数 |
156
+ | `BAWIKI_REV_ARONA_SEARCH_METHOD` | 否 | `3` | Arona 模糊搜索方法,详见 Arona API 文档 |
157
+ | `BAWIKI_REV_ARONA_FILTER_R18` | 否 | `True` | 默认是否过滤 R18 结果 |
158
+ | `BAWIKI_REV_ARONA_ALLOW_R18_PARAM` | 否 | `False` | 是否允许用户通过 `--r18` 查询 R18 |
159
+ | `BAWIKI_REV_ARONA_ALIAS_ONLY_SUPERUSER` | 否 | `False` | 是否仅允许超级用户管理别名 |
160
+ | `BAWIKI_REV_ARONA_SELECT_TIMEOUT` | 否 | `60.0` | 等待用户输入关键词或选择结果的超时时间(秒) |
161
+
162
+ ## 🎉 使用
163
+
164
+ ### PicMenu Next 集成
165
+
166
+ 推荐搭配 [PicMenu Next](https://github.com/lgc-NB2Dev/nonebot-plugin-picmenu-next) 插件使用
167
+
168
+ 安装并加载 `nonebot_plugin_picmenu_next` 后,本插件会与其联动,注册 `bawiki_revive` 菜单模板。
169
+
170
+ 该菜单模板是为 BAWiki Revive 单独准备的,包含首页、插件详情页和功能详情页。插件自身的详情页与功能详情页会默认使用它。
171
+
172
+ 此模板 99% 由 AI 设计,剩余 1% 为人工微调。
173
+
174
+ 如果想让 PicMenu 首页使用这套模板,可配置:
175
+
176
+ ```properties
177
+ PMN_INDEX_TEMPLATE=bawiki_revive
178
+ ```
179
+
180
+ 如果想让其他插件的详情页和功能详情页也使用这套模板,可继续配置:
181
+
182
+ ```properties
183
+ PMN_DETAIL_TEMPLATE=bawiki_revive
184
+ PMN_FUNC_DETAIL_TEMPLATE=bawiki_revive
185
+ ```
186
+
187
+ <details>
188
+ <summary>首页示例(点击展开/收起)</summary>
189
+
190
+ ![index sample](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/bawiki-revive/index_sample.jpg)
191
+
192
+ </details>
193
+
194
+ <details>
195
+ <summary>详情页示例(点击展开/收起 可以查看本插件功能列表)</summary>
196
+
197
+ ![detail sample](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/bawiki-revive/detail_sample.jpg)
198
+
199
+ </details>
200
+
201
+ <details>
202
+ <summary>功能详情页示例(点击展开/收起)</summary>
203
+
204
+ ![func detail sample](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/bawiki-revive/func_detail_sample.jpg)
205
+
206
+ </details>
207
+
208
+ ## 📞 联系
209
+
210
+ QQ:3076823485
211
+ Telegram:[@lgc2333](https://t.me/lgc2333)
212
+ 吹水群:[168603371](https://qm.qq.com/q/EikuZ5sP4G)
213
+ 邮箱:<lgc2333@126.com>
214
+
215
+ ## 💡 鸣谢
216
+
217
+ ### [Arona Bot 攻略数据公开计划](https://doc.arona.diyigemt.com/v1/api/)
218
+
219
+ - Arona Bot 数据源
220
+
221
+ ## 💰 赞助
222
+
223
+ **[赞助我](https://blog.lgc2333.top/donate)**
224
+
225
+ 感谢大家的赞助!你们的赞助将是我继续创作的动力!
226
+
227
+ ## 📝 更新日志
228
+
229
+ 芝士刚刚发布的插件,还没有更新日志的说 qwq~
@@ -0,0 +1,207 @@
1
+ <!-- markdownlint-disable MD031 MD033 MD036 MD041 -->
2
+
3
+ <div align="center">
4
+
5
+ <a href="https://v2.nonebot.dev/store">
6
+ <img src="https://raw.githubusercontent.com/A-kirami/nonebot-plugin-template/resources/nbp_logo.png" width="180" height="180" alt="NoneBotPluginLogo">
7
+ </a>
8
+
9
+ <p>
10
+ <img src="https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/plugin.svg" alt="NoneBotPluginText">
11
+ </p>
12
+
13
+ # NoneBot-Plugin-BAWiki-Revive
14
+
15
+ _✨ 蔚蓝档案综合插件,堂堂复活(并没完全复活) ✨_
16
+
17
+ <img src="https://img.shields.io/badge/python-3.10+-blue.svg" alt="python">
18
+ <a href="https://github.com/astral-sh/uv">
19
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/uv/main/assets/badge/v0.json" alt="uv">
20
+ </a>
21
+ <a href="https://wakatime.com/badge/user/b61b0f9a-f40b-4c82-bc51-0a75c67bfccf/project/f4778875-45a4-4688-8e1b-b8c844440abb">
22
+ <img src="https://wakatime.com/badge/user/b61b0f9a-f40b-4c82-bc51-0a75c67bfccf/project/f4778875-45a4-4688-8e1b-b8c844440abb.svg" alt="wakatime">
23
+ </a>
24
+
25
+ <br />
26
+
27
+ <a href="https://pydantic.dev">
28
+ <img src="https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/template/pyd-v1-or-v2.json" alt="Pydantic Version 1 Or 2" >
29
+ </a>
30
+ <a href="./LICENSE">
31
+ <img src="https://img.shields.io/github/license/lgc-NB2Dev/nonebot-plugin-bawiki-revive.svg" alt="license">
32
+ </a>
33
+ <a href="https://pypi.python.org/pypi/nonebot-plugin-bawiki-revive">
34
+ <img src="https://img.shields.io/pypi/v/nonebot-plugin-bawiki-revive.svg" alt="pypi">
35
+ </a>
36
+ <a href="https://pypi.python.org/pypi/nonebot-plugin-bawiki-revive">
37
+ <img src="https://img.shields.io/pypi/dm/nonebot-plugin-bawiki-revive" alt="pypi download">
38
+ </a>
39
+
40
+ <br />
41
+
42
+ <a href="https://registry.nonebot.dev/plugin/nonebot-plugin-bawiki-revive:nonebot_plugin_bawiki_revive">
43
+ <img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fnbbdg.lgc2333.top%2Fplugin%2Fnonebot-plugin-bawiki-revive" alt="NoneBot Registry">
44
+ </a>
45
+ <a href="https://registry.nonebot.dev/plugin/nonebot-plugin-bawiki-revive:nonebot_plugin_bawiki_revive">
46
+ <img src="https://img.shields.io/endpoint?url=https%3A%2F%2Fnbbdg.lgc2333.top%2Fplugin-adapters%2Fnonebot-plugin-bawiki-revive" alt="Supported Adapters">
47
+ </a>
48
+
49
+ </div>
50
+
51
+ ## 📖 介绍
52
+
53
+ 什么?BAWiki 复活了(但是好像并没有完全活)
54
+
55
+ 当前版本主要提供 Arona 攻略数据源查询功能。
56
+
57
+ ## 💿 安装
58
+
59
+ 以下提到的方法 任选**其一** 即可
60
+
61
+ <details open>
62
+ <summary>[推荐] 使用 nb-cli 安装</summary>
63
+ 在 nonebot2 项目的根目录下打开命令行,输入以下指令即可安装
64
+
65
+ ```bash
66
+ nb plugin install nonebot-plugin-bawiki-revive
67
+ ```
68
+
69
+ </details>
70
+
71
+ <details>
72
+ <summary>使用包管理器安装</summary>
73
+ 在 nonebot2 项目的插件目录下,打开命令行,根据你使用的包管理器,输入相应的安装命令
74
+
75
+ <details>
76
+ <summary>pip</summary>
77
+
78
+ ```bash
79
+ pip install nonebot-plugin-bawiki-revive
80
+ ```
81
+
82
+ </details>
83
+ <details>
84
+ <summary>pdm</summary>
85
+
86
+ ```bash
87
+ pdm add nonebot-plugin-bawiki-revive
88
+ ```
89
+
90
+ </details>
91
+ <details>
92
+ <summary>poetry</summary>
93
+
94
+ ```bash
95
+ poetry add nonebot-plugin-bawiki-revive
96
+ ```
97
+
98
+ </details>
99
+ <details>
100
+ <summary>conda</summary>
101
+
102
+ ```bash
103
+ conda install nonebot-plugin-bawiki-revive
104
+ ```
105
+
106
+ </details>
107
+
108
+ 打开 nonebot2 项目根目录下的 `pyproject.toml` 文件,在 `[tool.nonebot]` 部分的 `plugins` 项里追加写入
109
+
110
+ ```toml
111
+ [tool.nonebot]
112
+ plugins = [
113
+ # ...
114
+ "nonebot_plugin_bawiki_revive"
115
+ ]
116
+ ```
117
+
118
+ </details>
119
+
120
+ ## ⚙️ 配置
121
+
122
+ 在 NoneBot2 项目的 `.env` 文件中添加下表中的配置
123
+
124
+ | 配置项 | 必填 | 默认值 | 说明 |
125
+ | :-------------------------------------: | :--: | :-----: | :------------------------------------------: |
126
+ | **通用配置** | | | |
127
+ | `BAWIKI_REV_REQUEST_TIMEOUT` | 否 | `10.0` | 请求超时时间(秒) |
128
+ | `BAWIKI_REV_REQUEST_RETRY_ATTEMPTS` | 否 | `3` | 请求失败重试次数 |
129
+ | `BAWIKI_REV_REQUEST_RETRY_WAIT` | 否 | `1.0` | 每次请求重试前等待时间 |
130
+ | **Arona 配置** | | | |
131
+ | `BAWIKI_REV_ARONA_API_BASE_URL` | 否 | ... | Arona API 基地址 |
132
+ | `BAWIKI_REV_ARONA_CDN_BASE_URL` | 否 | ... | Arona 图片 CDN 基地址 |
133
+ | `BAWIKI_REV_ARONA_SEARCH_SIZE` | 否 | `8` | 模糊搜索返回结果数 |
134
+ | `BAWIKI_REV_ARONA_SEARCH_METHOD` | 否 | `3` | Arona 模糊搜索方法,详见 Arona API 文档 |
135
+ | `BAWIKI_REV_ARONA_FILTER_R18` | 否 | `True` | 默认是否过滤 R18 结果 |
136
+ | `BAWIKI_REV_ARONA_ALLOW_R18_PARAM` | 否 | `False` | 是否允许用户通过 `--r18` 查询 R18 |
137
+ | `BAWIKI_REV_ARONA_ALIAS_ONLY_SUPERUSER` | 否 | `False` | 是否仅允许超级用户管理别名 |
138
+ | `BAWIKI_REV_ARONA_SELECT_TIMEOUT` | 否 | `60.0` | 等待用户输入关键词或选择结果的超时时间(秒) |
139
+
140
+ ## 🎉 使用
141
+
142
+ ### PicMenu Next 集成
143
+
144
+ 推荐搭配 [PicMenu Next](https://github.com/lgc-NB2Dev/nonebot-plugin-picmenu-next) 插件使用
145
+
146
+ 安装并加载 `nonebot_plugin_picmenu_next` 后,本插件会与其联动,注册 `bawiki_revive` 菜单模板。
147
+
148
+ 该菜单模板是为 BAWiki Revive 单独准备的,包含首页、插件详情页和功能详情页。插件自身的详情页与功能详情页会默认使用它。
149
+
150
+ 此模板 99% 由 AI 设计,剩余 1% 为人工微调。
151
+
152
+ 如果想让 PicMenu 首页使用这套模板,可配置:
153
+
154
+ ```properties
155
+ PMN_INDEX_TEMPLATE=bawiki_revive
156
+ ```
157
+
158
+ 如果想让其他插件的详情页和功能详情页也使用这套模板,可继续配置:
159
+
160
+ ```properties
161
+ PMN_DETAIL_TEMPLATE=bawiki_revive
162
+ PMN_FUNC_DETAIL_TEMPLATE=bawiki_revive
163
+ ```
164
+
165
+ <details>
166
+ <summary>首页示例(点击展开/收起)</summary>
167
+
168
+ ![index sample](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/bawiki-revive/index_sample.jpg)
169
+
170
+ </details>
171
+
172
+ <details>
173
+ <summary>详情页示例(点击展开/收起 可以查看本插件功能列表)</summary>
174
+
175
+ ![detail sample](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/bawiki-revive/detail_sample.jpg)
176
+
177
+ </details>
178
+
179
+ <details>
180
+ <summary>功能详情页示例(点击展开/收起)</summary>
181
+
182
+ ![func detail sample](https://raw.githubusercontent.com/lgc-NB2Dev/readme/main/bawiki-revive/func_detail_sample.jpg)
183
+
184
+ </details>
185
+
186
+ ## 📞 联系
187
+
188
+ QQ:3076823485
189
+ Telegram:[@lgc2333](https://t.me/lgc2333)
190
+ 吹水群:[168603371](https://qm.qq.com/q/EikuZ5sP4G)
191
+ 邮箱:<lgc2333@126.com>
192
+
193
+ ## 💡 鸣谢
194
+
195
+ ### [Arona Bot 攻略数据公开计划](https://doc.arona.diyigemt.com/v1/api/)
196
+
197
+ - Arona Bot 数据源
198
+
199
+ ## 💰 赞助
200
+
201
+ **[赞助我](https://blog.lgc2333.top/donate)**
202
+
203
+ 感谢大家的赞助!你们的赞助将是我继续创作的动力!
204
+
205
+ ## 📝 更新日志
206
+
207
+ 芝士刚刚发布的插件,还没有更新日志的说 qwq~