From 6be9e477b1c918afcaec10172d96726f1bc7f208 Mon Sep 17 00:00:00 2001 From: HibiKier <45528451+HibiKier@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:29:01 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=AE=E5=A4=8D=E7=BE=A4?= =?UTF-8?q?=E7=BB=84=E4=B8=AD=E5=B8=AE=E5=8A=A9=E5=8A=9F=E8=83=BD=E7=8A=B6?= =?UTF-8?q?=E6=80=81=E6=98=BE=E7=A4=BA=E9=97=AE=E9=A2=98=20(#1650)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++--- .../admin/plugin_switch/_data_source.py | 8 +++++--- zhenxun/builtin_plugins/help/zhenxun_help.py | 11 +++++------ 3 files changed, 15 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 2a7ccd94..ccca5405 100644 --- a/README.md +++ b/README.md @@ -88,7 +88,7 @@ AccessToken: PUBLIC_ZHENXUN_TEST | :--------------------------------------------------------------------: | :------: | :-------------------------------------------------: | :---------------------------: | | [插件库](https://github.com/zhenxun-org/zhenxun_bot_plugins) | 插件 | [zhenxun-org](https://github.com/zhenxun-org) | 原 plugins 文件夹插件 | | [插件索引库](https://github.com/zhenxun-org/zhenxun_bot_plugins_index) | 插件 | [zhenxun-org](https://github.com/zhenxun-org) | 扩展插件索引库 | -| [一键安装](https://github.com/soloxiaoye2022/zhenxun_bot-deploy) | 安装 | [soloxiaoye2022](https://github.com/soloxiaoye2022) | 第三方试 | +| [一键安装](https://github.com/soloxiaoye2022/zhenxun_bot-deploy) | 安装 | [soloxiaoye2022](https://github.com/soloxiaoye2022) | 第三方 | | [WebUi](https://github.com/HibiKier/zhenxun_bot_webui) | 管理 | [hibikier](https://github.com/HibiKier) | 基于真寻 WebApi 的 webui 实现 | | [安卓 app(WebUi)](https://github.com/YuS1aN/zhenxun_bot_android_ui) | 安装 | [YuS1aN](https://github.com/YuS1aN) | 第三方 | @@ -158,6 +158,8 @@ playwright install-deps ' # 此处填写你的数据库地址 # 示例: "postgres://user:password@127.0.0.1:5432/database" + # 示例: "mysql://user:password@127.0.0.1:5432/database" + # 示例: "sqlite:data/db/zhenxun.db" 在data目录下建立db文件夹 DB_URL = "" # 数据库地址 @@ -166,7 +168,7 @@ playwright install-deps ``` -## 功能列表 (旧版列表) + ## [爱发电](https://afdian.net/@HibiKier) diff --git a/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py b/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py index dea6724f..b5c991bb 100644 --- a/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py +++ b/zhenxun/builtin_plugins/admin/plugin_switch/_data_source.py @@ -17,8 +17,11 @@ def delete_help_image(gid: str | None = None): file = GROUP_HELP_PATH / f"{gid}.png" if file.exists(): file.unlink() - elif HELP_FILE.exists(): - HELP_FILE.unlink() + else: + if HELP_FILE.exists(): + HELP_FILE.unlink() + for file in GROUP_HELP_PATH.iterdir(): + file.unlink() def plugin_row_style(column: str, text: str) -> RowStyle: @@ -155,7 +158,6 @@ async def build_task(group_id: str | None) -> BuildImage: class PluginManage: - @classmethod async def set_default_status(cls, plugin_name: str, status: bool) -> str: """设置插件进群默认状态 diff --git a/zhenxun/builtin_plugins/help/zhenxun_help.py b/zhenxun/builtin_plugins/help/zhenxun_help.py index 09ebd931..a08b49e3 100644 --- a/zhenxun/builtin_plugins/help/zhenxun_help.py +++ b/zhenxun/builtin_plugins/help/zhenxun_help.py @@ -28,13 +28,12 @@ def __handle_item(plugin: PluginInfo, group: GroupConsole | None): if not plugin.status: if plugin.block_type == BlockType.ALL: plugin.name = f"{plugin.name}(不可用)" - elif ( - group - and plugin.block_type == BlockType.GROUP - or not group - and plugin.block_type == BlockType.PRIVATE - ): + elif group and plugin.block_type == BlockType.GROUP: plugin.name = f"{plugin.name}(不可用)" + elif not group and plugin.block_type == BlockType.PRIVATE: + plugin.name = f"{plugin.name}(不可用)" + elif group and f"{plugin.module}," in group.block_plugin: + plugin.name = f"{plugin.name}(不可用)" return Item(plugin_name=f"{plugin.id}-{plugin.name}")