Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import praw
- import random
- reddit = praw.Reddit(
- client_id="",
- client_secret="",
- user_agent="",
- username="",
- password=""
- )
- hi_quotes = ['ok', 'bosf']
- subreddit = 'redditdev'
- for comment in reddit.subreddit(subreddit).stream.comments(skip_existing=True):
- if "hi" in comment.body.lower():
- print(f"Matched comment {comment.id} - now replying")
- random_index = random.randint(0,len(hi_quotes)-1)
- comment.reply(str(hi_quotes[random_index]))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement