Selaa lähdekoodia

fix: client cmd config bug

master
Saboteur7 4 kuukautta sitten
vanhempi
commit
1f7afaba07
2 muutettua tiedostoa jossa 6 lisäystä ja 2 poistoa
  1. +5
    -2
      common/linkai_client.py
  2. +1
    -0
      plugins/plugin.py

+ 5
- 2
common/linkai_client.py Näytä tiedosto

@@ -45,8 +45,11 @@ class ChatClient(LinkAIClient):
elif reply_voice_mode == "always_reply_voice":
local_config["always_reply_voice"] = True

if config.get("admin_password") and plugin_config.get("Godcmd"):
plugin_config["Godcmd"]["password"] = config.get("admin_password")
if config.get("admin_password"):
if not plugin_config.get("Godcmd"):
plugin_config["Godcmd"] = {"password": config.get("admin_password"), "admin_users": []}
else:
plugin_config["Godcmd"]["password"] = config.get("admin_password")
PluginManager().instances["GODCMD"].reload()

if config.get("group_app_map") and pconf("linkai"):


+ 1
- 0
plugins/plugin.py Näytä tiedosto

@@ -18,6 +18,7 @@ class Plugin:
if not plugin_conf:
# 全局配置不存在,则获取插件目录下的配置
plugin_config_path = os.path.join(self.path, "config.json")
logger.debug(f"loading plugin config, plugin_config_path={plugin_config_path}, exist={os.path.exists(plugin_config_path)}")
if os.path.exists(plugin_config_path):
with open(plugin_config_path, "r", encoding="utf-8") as f:
plugin_conf = json.load(f)


Loading…
Peruuta
Tallenna