Advertisement
Guest User

Untitled

a guest
Apr 26th, 2018
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.89 KB | None | 0 0
  1. def run_bot_2(r, comments_replied_to):
  2.         print("Obtaining 250 comments...")
  3.         for comment in r.subreddit('test').comments(limit=250):
  4.                 match = re.search("\[\[(.*?)\]\]", comment.body)
  5.                 if(match):
  6.                         if comment.id not in comments_replied_to:
  7.                                 if comment.author != r.user.me():
  8.                                         comment_reply = comment_message("Player Stats: \n\n", response(match.group(1), player_info))
  9.                                         comment.reply(comment_reply)
  10.                                         print("Replied to comment " + comment.id)
  11.                                         comments_replied_to.append(comment.id)
  12.                                         with open("comments_replied_to.text", "a") as f:
  13.                                                 f.write(comment.id + "\n")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement