moved posts.json folder to config/posts.json

This commit is contained in:
2026-02-22 22:41:30 +00:00
parent 2340560ca8
commit f4f9e36a35

View File

@@ -50,15 +50,15 @@ def main(reddit, posts: dict):
time.sleep(config.interval)
def load_posts():
if not os.path.exists("posts.json"):
with open("posts.json", "w+") as file:
if not os.path.exists("config/posts.json"):
with open("config/posts.json", "w+") as file:
json.dump({}, file)
with open("posts.json", "r+") as file:
with open("config/posts.json", "r+") as file:
data = json.load(file)
return data
def save_posts(data):
with open('posts.json', 'w+') as file:
with open('config/posts.json', 'w+') as file:
json.dump(data, file)