migrated to asyncPRAW (i fucking hate it but it made reddit shut the fuck up)

This commit is contained in:
2025-02-12 17:43:35 +01:00
parent 67052b1511
commit 069d615272
14 changed files with 121 additions and 130 deletions
+4 -2
View File
@@ -95,12 +95,14 @@ def write_data(bot: botPy.Bot) -> bool:
def add_post_to_data(bot: botPy.Bot, new_data: PostData, bypass_conditions: bool = False) -> bool:
if bypass_conditions:
bot.data[BK_WEEKLY][new_data.url] = new_data.to_json()
py_print(f"Added post \"{new_data.url}\" (Conditions bypassed)")
if bot.args["dev"]:
py_print(f"Added post \"{new_data.url}\" (Conditions bypassed)")
return True
if new_data.url not in bot.data[BK_WEEKLY]:
bot.data[BK_WEEKLY][new_data.url] = new_data.to_json()
py_print(f"Added post \"{new_data.url}\"")
if bot.args["dev"]:
py_print(f"Added post \"{new_data.url}\"")
return True
elif "removed" in bot.data[BK_WEEKLY][new_data.url]: