Added ability to specify custom conf directory
This commit is contained in:
parent
3e2f8e61b2
commit
264c099fad
1
.gitignore
vendored
1
.gitignore
vendored
@ -9,3 +9,4 @@ __pycache__/
|
||||
/*.log.txt
|
||||
/*.log.txt.*
|
||||
/database.db
|
||||
/conf_2
|
||||
|
0
comfyui-discord.sh
Normal file → Executable file
0
comfyui-discord.sh
Normal file → Executable file
@ -54,6 +54,10 @@ async def on_message_or_reaction(client, obj):
|
||||
#
|
||||
#
|
||||
|
||||
settings = get_settings()
|
||||
|
||||
CONFIG_DIR = settings["config_dir"]
|
||||
|
||||
chl_topic_parts = []
|
||||
chl_topic_part_1 = ""
|
||||
if chl.topic is not None:
|
||||
@ -62,11 +66,11 @@ async def on_message_or_reaction(client, obj):
|
||||
|
||||
# Try different paths to find workflow .json file:
|
||||
workflow_paths = [
|
||||
f"conf/{chl.category.name}/{chl_topic_part_1}",
|
||||
f"conf/{chl.category.name}/{chl.name}",
|
||||
f"conf/{chl_topic_part_1}",
|
||||
f"conf/{chl.name}",
|
||||
f"conf/{chl.category.name}",
|
||||
f"{CONFIG_DIR}{chl.category.name}/{chl_topic_part_1}",
|
||||
f"{CONFIG_DIR}{chl.category.name}/{chl.name}",
|
||||
f"{CONFIG_DIR}{chl_topic_part_1}",
|
||||
f"{CONFIG_DIR}{chl.name}",
|
||||
f"{CONFIG_DIR}{chl.category.name}",
|
||||
]
|
||||
|
||||
using_workflow_path = None
|
||||
@ -86,19 +90,19 @@ async def on_message_or_reaction(client, obj):
|
||||
#
|
||||
|
||||
setting_paths = [
|
||||
f"conf/{chl.category.name}",
|
||||
f"conf/{chl.name}",
|
||||
f"{CONFIG_DIR}{chl.category.name}",
|
||||
f"{CONFIG_DIR}{chl.name}",
|
||||
]
|
||||
|
||||
for i in chl_topic_parts:
|
||||
setting_paths = setting_paths + ["conf/" + i.strip()]
|
||||
setting_paths = setting_paths + [{CONFIG_DIR} + i.strip()]
|
||||
|
||||
setting_paths = setting_paths + [f"conf/{chl.category.name}/{chl.name}"]
|
||||
setting_paths = setting_paths + [f"{CONFIG_DIR}{chl.category.name}/{chl.name}"]
|
||||
|
||||
for i in chl_topic_parts:
|
||||
setting_paths = setting_paths + [f"conf/{chl.category.name}/" + i.strip()]
|
||||
setting_paths = setting_paths + [f"{CONFIG_DIR}{chl.category.name}/" + i.strip()]
|
||||
|
||||
settings = get_settings()
|
||||
|
||||
|
||||
for path in setting_paths:
|
||||
try_path = f"{path}_settings.json"
|
||||
|
@ -8,6 +8,7 @@ def get_settings(initialize=False):
|
||||
"handler_name": "default",
|
||||
"token": "PASTE_TOKEN_HERE",
|
||||
"api_url": "http://127.0.0.1:8188",
|
||||
"config_dir": "conf/",
|
||||
"allow_repeat": True,
|
||||
"show_repeat": True,
|
||||
"repeat_emoji": "♻️",
|
||||
|
Loading…
Reference in New Issue
Block a user