Advertisement
Guest User

Untitled

a guest
Jul 6th, 2017
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.57 KB | None | 0 0
  1. import praw
  2. import config
  3. import time
  4.  
  5.  
  6.  
  7.  
  8.  
  9. def bot_login():
  10.     print ("Logging in.")
  11.     r = praw.Reddit(username = config.username,
  12.             password = config.password,
  13.             client_id = config.client_id,
  14.             client_secret = config.client_secret,
  15.             user_agent = "Anti Suicide")
  16.  
  17.     print ("Logged in. Starting.")
  18.     return r
  19.  
  20.  
  21. def run_bot(r):
  22.  
  23.     for comment in r.subreddit('spampeoplehere') .comments(limit=1000):
  24.             if "$spam" in comment.body and not "$stop" in comment.body:
  25.                 comment.reply(comment.id)
  26.                 print ("Commented.")
  27.  
  28. r = bot_login ()
  29. while True:
  30.     run_bot (r)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement