Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- bot = praw.Reddit(user_agent='PencePlane',
- client_id='[REDACTED]',
- client_secret='[REDACTED]',
- username='PencePlane-Bot',
- password='[REDACTED]')
- comments = bot.get_comments("the_donald", gilded_only=False)
- searchStrings = ["pence plane", "no breaks"]
- pencePlaneSpeed = 0
- def bot():
- While True:
- for comment in comments:
- text = comment.body
- author = comment.author
- if comment.author != "PencePlane-Bot" or "/u/PencePlane-Bot" or "u/PencePlaneBot":
- if any(string in text for string in searchStrings):
- # Generate a message
- pencePlaneSpeed = pencePlaneSpeed + 100
- message = "THE PENCE PLANE HAS NO BRAKES. Current Speed: %s mph. Post by Pence Plane Bot v.0.1. Bot by /u/njmksr." % pencePlaneSpeed
- comment.reply(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement