mirror of
https://github.com/AstrBotDevs/AstrBot
synced 2026-07-20 02:55:08 +08:00
feat: update和切换模型指令以及keyword指令现在仅可管理员使用;
fix: 修复keyword指令在使用官方模型的时候会被识别为“赞助key”的指令的问题 #80
This commit is contained in:
@@ -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:
|
||||
# 得到本地版本号和最新版本号
|
||||
|
||||
Reference in New Issue
Block a user