From 87d67b98a842ad758c11a42437e6c414eb3972c1 Mon Sep 17 00:00:00 2001 From: Slfhstd Date: Wed, 25 Feb 2026 19:53:47 +0000 Subject: [PATCH] create default config if it doesn't exist --- flairtimercomment.py | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) diff --git a/flairtimercomment.py b/flairtimercomment.py index ffa7da8..7736f7a 100644 --- a/flairtimercomment.py +++ b/flairtimercomment.py @@ -1,9 +1,35 @@ import praw -import config + +import praw +import os import os.path import json import time - + +# Create default config/config.py if it doesn't exist +default_config_path = os.path.join('config', 'config.py') +if not os.path.exists(default_config_path): + os.makedirs('config', exist_ok=True) + with open(default_config_path, 'w') as f: + f.write( + 'username = ""\n' + 'password = ""\n' + 'client_id = ""\n' + 'client_secret = ""\n' + 'user_agent = "Flair Timer Comment Bot"\n' + '\n' + '# Subreddits\n' + 'subreddit = ""\n' + 'flair_text = "Waiting for OP"\n' + 'interval = 30\n' + 'hours = 48\n' + 'searchlimit = 600\n' + 'comment_message = ""\n' + 'lock_post = False\n' + 'distinguish_sticky = False\n' + ) + +import config def authentication(): print ("Authenticating...") reddit = praw.Reddit(username = config.username,