Skip to content

Instantly share code, notes, and snippets.

@Abrownn
Created November 24, 2019 23:34
Show Gist options
  • Save Abrownn/8bc711f76bef909f6b132c1405ad35b5 to your computer and use it in GitHub Desktop.
Save Abrownn/8bc711f76bef909f6b132c1405ad35b5 to your computer and use it in GitHub Desktop.
BotBust dun gone rogue, gotta get it outta there ASAP
#By using this script, you forfeit the right to judge me for my lack of proper fstring usage
import praw
import time
r = praw.Reddit(username = "",
password = "",
client_id = "",
client_secret = "",
user_agent = "")
yourSubs = []
for subreddit in r.user.moderator_subreddits(limit=None):
if subreddit not in yourSubs:
yourSubs.append(subreddit.display_name)
else:
continue
botbustSubs = []
path = "/user/botbust/moderated_subreddits"
response = r.get(path)
data = response['data']
for sub in data:
for key, value in sub.items():
if key == "sr":
if str(value) not in botbustSubs:
botbustSubs.append(str(value))
overlap = []
for sub in yourSubs:
if sub in botbustSubs:
overlap.append(sub)
print(str(overlap))
for sub in overlap:
print(sub)
overlap.remove(sub)
try:
r.subreddit(sub).moderator.remove("botbust")
print("Demodding from /r/" + str(sub))
time.sleep(2)
except:
print("Failed to demod from: " + str(sub))
time.sleep(3)
continue
time.sleep(3)
print("Done)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment