diff --git a/zhenxun/builtin_plugins/admin/plugin_switch/command.py b/zhenxun/builtin_plugins/admin/plugin_switch/command.py index 6d33b4df..8c3e8fab 100644 --- a/zhenxun/builtin_plugins/admin/plugin_switch/command.py +++ b/zhenxun/builtin_plugins/admin/plugin_switch/command.py @@ -133,16 +133,16 @@ _status_matcher.shortcut( ) _status_matcher.shortcut( - r"关闭(?P.+)", + r"关闭(插件|功能)df(?P.+)", command="switch", - arguments=["close", "{name}"], + arguments=["close", "{name}", "-df"], prefix=True, ) _status_matcher.shortcut( - r"关闭(插件|功能)df(?P.+)", + r"关闭(?P.+)", command="switch", - arguments=["close", "{name}", "-df"], + arguments=["close", "{name}"], prefix=True, ) diff --git a/zhenxun/models/group_console.py b/zhenxun/models/group_console.py index 25e539ea..8520b93d 100644 --- a/zhenxun/models/group_console.py +++ b/zhenxun/models/group_console.py @@ -1,11 +1,13 @@ -from typing import Any +from typing import Any, overload from typing_extensions import Self from tortoise import fields from tortoise.backends.base.client import BaseDBAsyncClient +from zhenxun.models.plugin_info import PluginInfo from zhenxun.models.task_info import TaskInfo from zhenxun.services.db_context import Model +from zhenxun.utils.enum import PluginType class GroupConsole(Model): @@ -49,6 +51,34 @@ class GroupConsole(Model): table_description = "群组信息表" unique_together = ("group_id", "channel_id") + @staticmethod + def format(name: str) -> str: + return f"<{name}," + + @overload + @classmethod + def convert_module_format(cls, data: str) -> list[str]: ... + + @overload + @classmethod + def convert_module_format(cls, data: list[str]) -> str: ... + + @classmethod + def convert_module_format(cls, data: str | list[str]) -> str | list[str]: + """ + 在 `