fix(config): improve reply loading and handle missing file

This commit is contained in:
2026-07-29 18:28:47 +05:00
parent 9ae5a077a4
commit 9478f7d793
+8 -6
View File
@@ -16,17 +16,19 @@ class Config:
try:
reply_lines = []
with open(file_path, "r", encoding="utf-8") as replies:
lines = replies.readlines()
for line_index, line in enumerate(lines):
for line in replies:
line = line.rstrip("\n")
if not line:
continue
if " || " in line:
options = line.split(" || ")
options = [o.strip() for o in line.split(" || ")]
else:
options = [line]
reply_lines.append(options)
reply_lines[line_index] = options
return reply_lines if reply_lines else [[""]]
except:
except FileNotFoundError:
return [[""]]
def _load(self):