diff --git a/liteyuki/plugins/liteyuki_npm/installer.py b/liteyuki/plugins/liteyuki_npm/installer.py index a7c7792e..7a912d1b 100644 --- a/liteyuki/plugins/liteyuki_npm/installer.py +++ b/liteyuki/plugins/liteyuki_npm/installer.py @@ -46,7 +46,6 @@ npm_alc = on_alconna( permission=SUPERUSER ) - @npm_alc.handle() async def _(result: Arparma, event: T_MessageEvent, bot: T_Bot): ulang = get_user_lang(str(event.user_id)) diff --git a/liteyuki/utils/config.py b/liteyuki/utils/config.py index 04483ba5..ec8e3a2d 100644 --- a/liteyuki/utils/config.py +++ b/liteyuki/utils/config.py @@ -24,9 +24,15 @@ def load_from_yaml(file: str) -> dict: yaml.dump(BasicConfig().dict(), f, default_flow_style=False) with open(file, "r", encoding="utf-8") as f: - conf = yaml.load(f, Loader=yaml.FullLoader) + conf = init_conf(yaml.load(f, Loader=yaml.FullLoader)) config = conf if conf is None: nonebot.logger.warning(f"Config file {file} is empty, use default config. please modify it and restart") conf = BasicConfig().dict() return conf + + +def init_conf(conf: dict) -> dict: + if "" not in conf.get("command_start", []): + conf["alconna_use_command_start"] = True + return conf diff --git a/liteyuki/utils/message.py b/liteyuki/utils/message.py index 39850455..fb8ca90d 100644 --- a/liteyuki/utils/message.py +++ b/liteyuki/utils/message.py @@ -146,7 +146,7 @@ class Markdown: markdown格式的可点击回调按钮 """ - if "" not in config.get("command_start", ["/"]): + if "" not in config.get("command_start", ["/"]) and config.get("alconna_use_command_start", False): cmd = f"{config['command_start'][0]}{cmd}" return f"[{name}](mqqapi://aio/inlinecmd?command={quote(cmd)}&reply={str(reply).lower()}&enter={str(enter).lower()})"