From 62f49eb381f6d8aaadcf947f15309f6b01fa82f0 Mon Sep 17 00:00:00 2001 From: Rikka-desu <2273379351@qq.com> Date: Sun, 24 Nov 2024 15:59:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=86at=E6=97=B6=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E5=91=BD=E4=BB=A4=E4=BC=9A=E5=AF=BC=E8=87=B4=E8=81=8A?= =?UTF-8?q?=E5=A4=A9=E4=B9=9F=E8=A7=A6=E5=8F=91=E7=9A=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 2 +- nonebot_plugin_marshoai/azure.py | 27 ++++++++++++++++----------- 2 files changed, 17 insertions(+), 12 deletions(-) diff --git a/README.md b/README.md index 26673b85..4975fa9b 100644 --- a/README.md +++ b/README.md @@ -142,7 +142,7 @@ _✨ 使用 OpenAI 标准格式 API 的聊天机器人插件 ✨_ | --------------------- | ---------- | ----------- | ----------------- | | MARSHOAI_DEFAULT_NAME | `str` | `marsho` | 调用 Marsho 默认的命令前缀 | | MARSHOAI_ALIASES | `set[str]` | `set{"小棉"}` | 调用 Marsho 的命令别名 | -| MARSHOAI_AT | `bool` | `False` | 决定是否使用at触发 +| MARSHOAI_AT | `bool` | `false` | 决定是否使用at触发 #### AI 调用 diff --git a/nonebot_plugin_marshoai/azure.py b/nonebot_plugin_marshoai/azure.py index 1a981f98..f5f0f42d 100644 --- a/nonebot_plugin_marshoai/azure.py +++ b/nonebot_plugin_marshoai/azure.py @@ -37,31 +37,36 @@ async def at_enable(): driver = get_driver() -changemodel_cmd = on_command("changemodel", permission=SUPERUSER) -resetmem_cmd = on_command("reset") +changemodel_cmd = on_command("changemodel", permission=SUPERUSER, priority=10, block=True) +resetmem_cmd = on_command("reset", priority=10, block=True) # setprompt_cmd = on_command("prompt",permission=SUPERUSER) -praises_cmd = on_command("praises", permission=SUPERUSER) -add_usermsg_cmd = on_command("usermsg", permission=SUPERUSER) -add_assistantmsg_cmd = on_command("assistantmsg", permission=SUPERUSER) -contexts_cmd = on_command("contexts", permission=SUPERUSER) -save_context_cmd = on_command("savecontext", permission=SUPERUSER) -load_context_cmd = on_command("loadcontext", permission=SUPERUSER) +praises_cmd = on_command("praises", permission=SUPERUSER, priority=10, block=True) +add_usermsg_cmd = on_command("usermsg", permission=SUPERUSER, priority=10, block=True) +add_assistantmsg_cmd = on_command("assistantmsg", permission=SUPERUSER, priority=10, block=True) +contexts_cmd = on_command("contexts", permission=SUPERUSER, priority=10, block=True) +save_context_cmd = on_command("savecontext", permission=SUPERUSER, priority=10, block=True) +load_context_cmd = on_command("loadcontext", permission=SUPERUSER, priority=10, block=True) marsho_cmd = on_alconna( Alconna( config.marshoai_default_name, Args["text?", AllParam], ), aliases=config.marshoai_aliases, + priority=10, + block=True ) -marsho_at = on_message(rule=to_me()&at_enable) +marsho_at = on_message(rule=to_me()&at_enable, priority=11) nickname_cmd = on_alconna( Alconna( "nickname", Args["name?", str], - ) + ), + priority = 10, + block = True ) -refresh_data_cmd = on_command("refresh_data", permission=SUPERUSER) +refresh_data_cmd = on_command("refresh_data", permission=SUPERUSER, priority=10, block=True) +command_start = driver.config.command_start model_name = config.marshoai_default_model context = MarshoContext() tools = MarshoTools()