Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- SUB = "somesub" # subreddit to watch for comments
- TO_SKIP = ['HappySilveon', 'AutoModerator'] # list of users to ignore
- SUBJECT = "Some subject" # required subject for the PM
- REPLY = "PM content here." # The content of the PM we'll respond with
- def main():
- reddit = praw.Reddit(user_agent='/u/HappySilveon reply script',
- client_id='CLIENT_ID', client_secret='CLIENT_SECRET',
- username='USERNAME', password='PASSWORD')
- sub = reddit.subreddit(SUB)
- for cmt in sub.stream.comments(skip_existing=True):
- user = str(cmt.author)
- if user not in TO_SKIP:
- reddit.redditor(user).message(SUBJECT, REPLY)
- if __name__ == '__main__':
- main()
Add Comment
Please, Sign In to add comment