mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-11 06:39:59 +08:00
🐛 修复群组中帮助功能状态显示问题 (#1650)
This commit is contained in:
@@ -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:
|
||||
"""设置插件进群默认状态
|
||||
|
||||
@@ -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}")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user