diff --git a/pkg/qqbot/cmds/system/cmds.py b/pkg/qqbot/cmds/system/cmds.py deleted file mode 100644 index 40d1cc2b..00000000 --- a/pkg/qqbot/cmds/system/cmds.py +++ /dev/null @@ -1,39 +0,0 @@ -from ..aamgr import AbstractCommandNode, Context, __command_list__ - - -@AbstractCommandNode.register( - parent=None, - name="cmd", - description="显示指令列表", - usage="!help\n!help <指令名称>", - aliases=[], - privilege=1 -) -class CmdCommand(AbstractCommandNode): - @classmethod - def process(cls, ctx: Context) -> tuple[bool, list]: - command_list = __command_list__ - - reply = [] - - if len(ctx.params) == 0: - reply_str = "[bot]当前所有指令:\n\n" - - # 遍历顶级指令 - for key in command_list: - command = command_list[key] - if command['parent'] is None: - reply_str += "!{} - {}\n".format(key, command['description']) - - reply_str += "\n请使用 !cmd <指令名称> 来查看指令的详细信息" - - reply = [reply_str] - else: - command_name = ctx.params[0] - if command_name in command_list: - reply = [command_list[command_name]['cls'].help()] - else: - reply = ["[bot]指令 {} 不存在".format(command_name)] - - return True, reply - \ No newline at end of file diff --git a/pkg/qqbot/cmds/system/help.py b/pkg/qqbot/cmds/system/help.py index 72e06d71..798cbf58 100644 --- a/pkg/qqbot/cmds/system/help.py +++ b/pkg/qqbot/cmds/system/help.py @@ -12,8 +12,13 @@ from ..aamgr import AbstractCommandNode, Context class HelpCommand(AbstractCommandNode): @classmethod def process(cls, ctx: Context) -> tuple[bool, list]: + import tips + reply = ["[bot] "+tips.help_message + "\n请输入 !cmd 查看指令列表"] + + # 警告config.help_message过时 import config - reply = [(config.help_message) + "\n请输入 !cmds 查看指令列表"] + if hasattr(config, "help_message"): + reply[0] += "\n\n警告:config.py中的help_message已过时,不再生效,请使用tips.py中的help_message替代" return True, reply \ No newline at end of file