Exemple #1
0
def remove(data,msg,r,mail,message):
	logging.warning("Remove Command")
	lines = separate_mail(mail.body)
	username = str(data["running_username"]).lower()
	for line in lines:
		links = r.get_submission(line).comments
		for comment in links:
			if comments.check_already_replied(data,msg["confirmation"],comment.replies,username):
				for reply in comment.replies:
					if reply.author:
						if str(reply.author.name).lower() == username:
							reply.delete()
				awardee_comment = r.get_info(thing_id=comment.parent_id)
				if awardee_comment.author:
					awardee = str(awardee_comment.author.name).lower()
					flair_count = token.start_decrement(data,msg,r,awardee)
					wiki.remove_wiki_line(data,msg,r,comment.permalink,awardee,flair_count)
				messages.remove(message)
				# comment.reply(message).distinguish()
				comment.unsave()
				comment.remove(spam=False)
				wiki.remove_queue_line(data,msg,r,line)
				print("Placeholder: Remove text from scoreboard")
			else:
				logging.warning("No token to remove.")
		wait()
	r.send_message("/r/" + data["running_subreddit"],"Remove Detected","Remove from %s detected on:\n\n%s" % (mail.author.name,mail.body))
Exemple #2
0
def approve(data,msg,r,mail):
	logging.debug("Approve Command")
	lines = separate_mail(mail.body)
	for line in lines:
		wiki.remove_queue_line(data,r,line)
		wait()