feat: update和切换模型指令以及keyword指令现在仅可管理员使用;

fix: 修复keyword指令在使用官方模型的时候会被识别为“赞助key”的指令的问题 #80
This commit is contained in:
Soulter
2023-04-08 23:58:46 +08:00
parent 9bca158174
commit 15c8f0b6f7
5 changed files with 86 additions and 39 deletions

View File

@@ -27,7 +27,9 @@ class Command:
return True
return False
def keyword(self, message: str):
def keyword(self, message: str, role: str):
if role != "admin":
return True, "你没有权限使用该指令", "keyword"
if len(message.split(" ")) != 3:
return True, "【设置关键词/关键指令回复】示例:\nkeyword hi 你好\n当发送hi的时候会回复你好\nkeyword /hi 你好\n当发送/hi时会回复你好", "keyword"
@@ -45,7 +47,9 @@ class Command:
except BaseException as e:
return False, "设置失败: "+str(e), "keyword"
def update(self, message: str):
def update(self, message: str, role: str):
if role != "admin":
return True, "你没有权限使用该指令", "keyword"
l = message.split(" ")
if len(l) == 1:
# 得到本地版本号和最新版本号