fix: 将除去昵称和@后,/开头的消息都视为指令

This commit is contained in:
Soulter
2023-04-14 22:43:15 +08:00
parent e7b9d7cd54
commit fbfceb3137
4 changed files with 10 additions and 0 deletions

View File

@@ -56,6 +56,7 @@ class Command:
"update latest": "更新到最新版本",
"update r": "重启程序",
"reset": "重置会话",
"nick": "设置机器人昵称",
"/bing": "切换到bing模型",
"/gpt": "切换到OpenAI ChatGPT API",
"/revgpt": "切换到网页版ChatGPT",

View File

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

View File

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

View File

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