From 8781b1e976e5ff7278058cee9e9f6fd61e51fe47 Mon Sep 17 00:00:00 2001 From: lanvent Date: Wed, 26 Apr 2023 01:05:23 +0800 Subject: [PATCH] fix: role,dungeon,godcmd support azure bot --- plugins/dungeon/dungeon.py | 2 +- plugins/godcmd/godcmd.py | 4 ++-- plugins/role/role.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/dungeon/dungeon.py b/plugins/dungeon/dungeon.py index 5b129d6..07fbde7 100644 --- a/plugins/dungeon/dungeon.py +++ b/plugins/dungeon/dungeon.py @@ -64,7 +64,7 @@ class Dungeon(Plugin): if e_context["context"].type != ContextType.TEXT: return bottype = Bridge().get_bot_type("chat") - if bottype not in (const.CHATGPT, const.OPEN_AI): + if bottype not in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]: return bot = Bridge().get_bot("chat") content = e_context["context"].content[:] diff --git a/plugins/godcmd/godcmd.py b/plugins/godcmd/godcmd.py index 99d5632..ecfb0c0 100644 --- a/plugins/godcmd/godcmd.py +++ b/plugins/godcmd/godcmd.py @@ -265,7 +265,7 @@ class Godcmd(Plugin): except Exception as e: ok, result = False, "你没有设置私有api_key" elif cmd == "reset": - if bottype in (const.CHATGPT, const.OPEN_AI): + if bottype in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]: bot.sessions.clear_session(session_id) channel.cancel_session(session_id) ok, result = True, "会话已重置" @@ -288,7 +288,7 @@ class Godcmd(Plugin): load_config() ok, result = True, "配置已重载" elif cmd == "resetall": - if bottype in (const.CHATGPT, const.OPEN_AI): + if bottype in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]: channel.cancel_all_session() bot.sessions.clear_all_session() ok, result = True, "重置所有会话成功" diff --git a/plugins/role/role.py b/plugins/role/role.py index 69c5233..4f1dc87 100644 --- a/plugins/role/role.py +++ b/plugins/role/role.py @@ -98,8 +98,8 @@ class Role(Plugin): def on_handle_context(self, e_context: EventContext): if e_context["context"].type != ContextType.TEXT: return - bottype = Bridge().get_bot_type("chat") - if bottype not in (const.CHATGPT, const.OPEN_AI): + btype = Bridge().get_bot_type("chat") + if btype not in [const.OPEN_AI, const.CHATGPT, const.CHATGPTONAZURE]: return bot = Bridge().get_bot("chat") content = e_context["context"].content[:]