Advertisement
Guest User

Untitled

a guest
Oct 29th, 2016
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.84 KB | None | 0 0
  1. import praw
  2. bot = praw.Reddit(user_agent='PencePlane',
  3.                    client_id='[REDACTED]',
  4.                    client_secret='[REDACTED]',
  5.                    username='PencePlane-Bot',
  6.                    password='[REDACTED]')
  7.  
  8. comments = bot.get_comments("the_donald", gilded_only=False)
  9.  
  10. searchStrings = ["pence plane", "no breaks"]
  11.  
  12. pencePlaneSpeed = 0
  13.  
  14. def bot():
  15.     While True:
  16.         for comment in comments:
  17.             text = comment.body
  18.             author = comment.author
  19.             if comment.author != "PencePlane-Bot" or "/u/PencePlane-Bot" or "u/PencePlaneBot":
  20.                 if any(string in text for string in searchStrings):
  21.                  # Generate a message
  22.                     pencePlaneSpeed = pencePlaneSpeed + 100
  23.                     message = "THE PENCE PLANE HAS NO BRAKES. Current Speed: %s mph. Post by Pence Plane Bot v.0.1. Bot by /u/njmksr." % pencePlaneSpeed
  24.                     comment.reply(message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement