diff options
author | jwansek <eddie.atten@yahoo.co.uk> | 2019-01-01 12:34:50 +0000 |
---|---|---|
committer | jwansek <eddie.atten@yahoo.co.uk> | 2019-01-01 12:34:50 +0000 |
commit | c8087aea0dbff1a2abf474a987465e817e5ad611 (patch) | |
tree | 358366a592908882defa932c0c3ed706218f2fb8 | |
parent | bebe783ec55d789b11343a621acc9c89df91a673 (diff) | |
download | SmallYTChannelBot-c8087aea0dbff1a2abf474a987465e817e5ad611.tar.gz SmallYTChannelBot-c8087aea0dbff1a2abf474a987465e817e5ad611.zip |
fixed a bug and added archive prog
-rw-r--r-- | SmallYTChannelBotSubmissions.py | 2 | ||||
-rw-r--r-- | archive_posts.py | 25 |
2 files changed, 26 insertions, 1 deletions
diff --git a/SmallYTChannelBotSubmissions.py b/SmallYTChannelBotSubmissions.py index fa8f209..2a58aae 100644 --- a/SmallYTChannelBotSubmissions.py +++ b/SmallYTChannelBotSubmissions.py @@ -207,7 +207,7 @@ def main(): db.change_lambda(user, -toremove) except Exception as e: print("[ERROR while removing λ] %s" % e) - text = r"An error was encountered. Please use the syntax `!givelambda [user] [how much to remove {integer}] [reason]`" + text = r"An error was encountered. Please use the syntax `!takelambda [user] [how much to remove {integer}] [reason]`" update_users_flair(comment) reply = comment.reply(text + tail) diff --git a/archive_posts.py b/archive_posts.py new file mode 100644 index 0000000..a68feaf --- /dev/null +++ b/archive_posts.py @@ -0,0 +1,25 @@ +import praw +import database +import login + +reddit = login.REDDIT + +subreddit = reddit.subreddit("jwnskanzkwktest") +db = database.Database() + +comment_stream = subreddit.stream.comments(pause_after=-1) +submission_stream = subreddit.stream.submissions(pause_after=-1) +while True: + for comment in comment_stream: + if comment is None: + break + if not db.id_in_blacklist(comment.id): + print("archived: ", comment.id) + db.add_to_blacklist(comment.id) + + for submission in submission_stream: + if submission is None: + break + if not db.id_in_blacklist(submission.id): + print("archived: ", submission.id) + db.add_to_blacklist(submission.id)
\ No newline at end of file |