Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- reddit = praw.Reddit(client_id='ID_here',
- client_secret='secret_here',
- username='username_here',
- password='password_here',
- user_agent='user_agent_here')
- print(reddit.user.me())
- sub = reddit.subreddit('all')
- sub.filters.add('literallyanysubreddithere')
- comments = sub.stream.comments()
- for comment in comments:
- text = comment.body
- author = comment.author
- subname = comment.subreddit
- if comment.author != "mybotname":
- if "triggerword" in text and "otherword" not in text:
- message = "Message here."
- comment.reply(message)
- print('Comment found and reply to user "{1}" posted in subreddit "{0}"!'.format(subname, author))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement