added support for language files

This commit is contained in:
2025-04-06 15:43:35 +02:00
parent eb0991df53
commit 0c87e5f56a
28 changed files with 1087 additions and 973 deletions
+3 -3
View File
@@ -66,7 +66,7 @@ class PostData:
def read_data(bot: botPy.Bot) -> bool:
r_path = os.path.join(DATA_PATH, "reddit_data.json")
r_path = os.path.join(DATA_PATH, "re_data.json")
if os.path.isfile(r_path):
bot.data_f = open(r_path, "r+")
@@ -75,8 +75,8 @@ def read_data(bot: botPy.Bot) -> bool:
if not bot.args["py"]:
return False
py_print("reddit_data.json not found, creating new from preset...")
with open(os.path.join(DATA_PATH, "reddit_data_preset.json", "r")) as f:
py_print("re_data.json not found, creating new from preset...")
with open(os.path.join(DATA_PATH, "re_data_preset.json", "r")) as f:
data_preset_json = json.load(f)
data_preset_json[botPy.BK_WEEKLY].pop("EXAMPLE VALUE", None)
+1 -1
View File
@@ -40,7 +40,7 @@ async def main():
rd = data.read_data(bot)
if data_retries == 5 and not rd:
raise Exception("Couldn't read reddit_data.json: File doesn't exist")
raise Exception("Couldn't read re_data.json: File doesn't exist")
py_print("Successfully read data!")