mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🐛 修复群组中帮助功能状态显示问题 (#1650)
This commit is contained in:
parent
207f947a1c
commit
6be9e477b1
@ -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) | 插件 | [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/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 实现 |
|
| [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) | 第三方 |
|
| [安卓 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"
|
# 示例: "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 = "" # 数据库地址
|
DB_URL = "" # 数据库地址
|
||||||
|
|
||||||
|
|
||||||
@ -166,7 +168,7 @@ playwright install-deps
|
|||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 功能列表 (旧版列表)
|
<!-- ## 功能列表 (旧版列表)
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>已实现的功能</summary>
|
<summary>已实现的功能</summary>
|
||||||
@ -314,7 +316,7 @@ playwright install-deps
|
|||||||
- [x] 定时更新权限
|
- [x] 定时更新权限
|
||||||
- [x] 自动配置重载
|
- [x] 自动配置重载
|
||||||
|
|
||||||
</details>
|
</details> -->
|
||||||
|
|
||||||
## [爱发电](https://afdian.net/@HibiKier)
|
## [爱发电](https://afdian.net/@HibiKier)
|
||||||
|
|
||||||
|
|||||||
@ -17,8 +17,11 @@ def delete_help_image(gid: str | None = None):
|
|||||||
file = GROUP_HELP_PATH / f"{gid}.png"
|
file = GROUP_HELP_PATH / f"{gid}.png"
|
||||||
if file.exists():
|
if file.exists():
|
||||||
file.unlink()
|
file.unlink()
|
||||||
elif HELP_FILE.exists():
|
else:
|
||||||
HELP_FILE.unlink()
|
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:
|
def plugin_row_style(column: str, text: str) -> RowStyle:
|
||||||
@ -155,7 +158,6 @@ async def build_task(group_id: str | None) -> BuildImage:
|
|||||||
|
|
||||||
|
|
||||||
class PluginManage:
|
class PluginManage:
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
async def set_default_status(cls, plugin_name: str, status: bool) -> str:
|
async def set_default_status(cls, plugin_name: str, status: bool) -> str:
|
||||||
"""设置插件进群默认状态
|
"""设置插件进群默认状态
|
||||||
|
|||||||
@ -28,13 +28,12 @@ def __handle_item(plugin: PluginInfo, group: GroupConsole | None):
|
|||||||
if not plugin.status:
|
if not plugin.status:
|
||||||
if plugin.block_type == BlockType.ALL:
|
if plugin.block_type == BlockType.ALL:
|
||||||
plugin.name = f"{plugin.name}(不可用)"
|
plugin.name = f"{plugin.name}(不可用)"
|
||||||
elif (
|
elif group and plugin.block_type == BlockType.GROUP:
|
||||||
group
|
|
||||||
and plugin.block_type == BlockType.GROUP
|
|
||||||
or not group
|
|
||||||
and plugin.block_type == BlockType.PRIVATE
|
|
||||||
):
|
|
||||||
plugin.name = f"{plugin.name}(不可用)"
|
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}")
|
return Item(plugin_name=f"{plugin.id}-{plugin.name}")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user