-
-
Save WorkingCodeClickFork/826fed0fabccb824ec9ea4fc86956200 to your computer and use it in GitHub Desktop.
Script to ban members of a discord servers.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
""" | |
# WARNING! | |
# DO not use this script for malicious purposes! | |
# Original Author: daegontaven - taven#0001 | |
# License: Public Domain | |
#How to use: | |
#make a bot | |
#make the bot inside the bot | |
#enable all the intents for the bot | |
#run this script | |
#boom everyone gets banned(if the bot is in the server) | |
# How to Install | |
1 - Download Python 3.7 or 3.6 : https://www.python.org/downloads/ | |
2 - Run this command : python3 -m pip install discord.py | |
3 - Run this command : python3 discord-ban-bot.py | |
4 - Invite bot to the servers you want to ban members from. | |
5 - Wait until banning is done. Don't close the terminal. This may take a while. | |
""" | |
import discord | |
from discord.ext import commands | |
client = commands.Bot("!", intents=discord.Intents.all()) | |
Token="" #bot token | |
Skip_Bots=False | |
send_on_ban=False # if True it will send a dm to the user | |
ban_message="You were banned!" # the message if send_on_ban is true | |
@client.event | |
async def on_ready(): | |
for i in client.guilds: #Get all the guilds | |
for m in i.members: #Get all the members inside the guild | |
if m.bot and Skip_Bots!=False: | |
return | |
try: | |
if send_on_ban==True: | |
try: | |
await m.send(ban_message) | |
print(f"Dmmed {m.display_name}") | |
except: | |
print(f"Couldn't dm {m.display_name}") | |
pass | |
await m.ban(reason="Banned by banbot") | |
print(f"banned {m.display_name}") | |
except: | |
print(f"Couldn't Ban {m.display_name}") | |
print("Banning Completed") | |
client.run(Token) |
wdym Make the bot inside a bot?
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Make a workinf verison in revisions :/