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):