feat: 支持命令限权

This commit is contained in:
Rock Chin
2023-03-31 06:49:13 +00:00
parent 73dccb21f5
commit df494da9e4
3 changed files with 20 additions and 1 deletions

View File

@@ -197,6 +197,7 @@ def start(first_time_init=False):
try:
pkg.openai.dprompt.register_all()
pkg.qqbot.cmds.mgr.register_all()
pkg.qqbot.cmds.mgr.apply_privileges()
except Exception as e:
logging.error(e)
traceback.print_exc()
@@ -372,6 +373,10 @@ def check_file():
if not os.path.exists("scenario/default.json"):
shutil.copy("scenario/default-template.json", "scenario/default.json")
# 检查cmdpriv.json
if not os.path.exists("cmdpriv.json"):
shutil.copy("cmdpriv-template.json", "cmdpriv.json")
# 检查temp目录
if not os.path.exists("temp/"):
os.mkdir("temp/")