Added blacklist

master
Keith Irwin 2017-09-08 16:11:35 +00:00
parent 25e9ee5222
commit 294f02cb7b
No known key found for this signature in database
GPG Key ID: 378933C743E2BBC0
1 changed files with 20 additions and 14 deletions

View File

@ -9,11 +9,17 @@ reddit = praw.Reddit('DEFAULT')
rall = reddit.subreddit('all')
sub = reddit.subreddit('IsAnybodyHere')
# Blacklist (by mod request)
blacklist = {'test','neoliberal'}
print("Started IsAnybodyHereBot...")
# Search latest comments in r/all
for comment in rall.stream.comments():
# Check for blacklist
if comment.subreddit.display_name.lower() not in blacklist:
# Match with regex
match = re.search("(does|has|is)(n't)? (any one|anyone|someone|anybody) (here)? (.*?)\?", comment.body, re.IGNORECASE)
if match: