From fbfceb313701fdb605760b3a7909374737b2397d Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Fri, 14 Apr 2023 22:43:15 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=B0=86=E9=99=A4=E5=8E=BB=E6=98=B5?= =?UTF-8?q?=E7=A7=B0=E5=92=8C@=E5=90=8E=EF=BC=8C/=E5=BC=80=E5=A4=B4?= =?UTF-8?q?=E7=9A=84=E6=B6=88=E6=81=AF=E9=83=BD=E8=A7=86=E4=B8=BA=E6=8C=87?= =?UTF-8?q?=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- model/command/command.py | 1 + model/command/command_openai_official.py | 3 +++ model/command/command_rev_chatgpt.py | 3 +++ model/command/command_rev_edgegpt.py | 3 +++ 4 files changed, 10 insertions(+) diff --git a/model/command/command.py b/model/command/command.py index 74b45c026..54b356f20 100644 --- a/model/command/command.py +++ b/model/command/command.py @@ -56,6 +56,7 @@ class Command: "update latest": "更新到最新版本", "update r": "重启程序", "reset": "重置会话", + "nick": "设置机器人昵称", "/bing": "切换到bing模型", "/gpt": "切换到OpenAI ChatGPT API", "/revgpt": "切换到网页版ChatGPT", diff --git a/model/command/command_openai_official.py b/model/command/command_openai_official.py index df1bd3698..dcbb8a0b6 100644 --- a/model/command/command_openai_official.py +++ b/model/command/command_openai_official.py @@ -37,6 +37,9 @@ class CommandOpenAIOfficial(Command): elif self.command_start_with(message, "key"): return True, self.key(message, user_name) + if self.command_start_with(message, "/"): + return True, (False, "未知指令", "unknown_command") + return False, None def help(self): diff --git a/model/command/command_rev_chatgpt.py b/model/command/command_rev_chatgpt.py index ce545da1e..6b33edeba 100644 --- a/model/command/command_rev_chatgpt.py +++ b/model/command/command_rev_chatgpt.py @@ -17,6 +17,9 @@ class CommandRevChatGPT(Command): return True, self.update(message, role) elif self.command_start_with(message, "keyword"): return True, self.keyword(message, role) + + if self.command_start_with(message, "/"): + return True, (False, "未知指令", "unknown_command") return False, None def reset(self): diff --git a/model/command/command_rev_edgegpt.py b/model/command/command_rev_edgegpt.py index 5135ea68a..b7e0fe20a 100644 --- a/model/command/command_rev_edgegpt.py +++ b/model/command/command_rev_edgegpt.py @@ -17,6 +17,9 @@ class CommandRevEdgeGPT(Command): return True, self.update(message, role) elif self.command_start_with(message, "keyword"): return True, self.keyword(message, role) + + if self.command_start_with(message, "/"): + return True, (False, "未知指令", "unknown_command") return False, None def reset(self, loop):