Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I wasn't able to ignore the mess #22

Closed
wants to merge 8 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ As of recent, I've seen multiple Discord communities I have been a part of been
Download the files for the bot and make sure Python 3.7 is installed.
After you have done those steps, simply install the following dependencies:

* discord.py REWRITE
* discord.py

You can do this by typing `pip install -U git+https://github.com/Rapptz/discord.py@rewrite` into cmd as long as Python is in path.
You can do this by typing `pip install -U -r requirements.txt` into cmd as long as Python is in path.

After this, open the bot file in an IDE or text editor and input your token and desired prefix.

Expand Down
300 changes: 166 additions & 134 deletions innocent.py
Original file line number Diff line number Diff line change
@@ -1,166 +1,198 @@
# CONFIG
# ---------
token = "" # To find this, it's harder than it used to be. Please Google the process.
prefix = "~" # This will be used at the start of commands.
token = "" # To find this, it's harder than it used to be. Please Google the process.
prefix = "~" # This will be used at the start of commands.
# ----------

import discord
# Import the needed libs.
from discord.ext import commands
# Imports the needed libs.

print ("Loading..")
print("Loading..")

# Declare the bot, pass it a prefix and let it know to only listen to itself.
bot = commands.Bot(command_prefix=prefix, self_bot=True)
bot.remove_command("help")
# Declares the bot, passes it a prefix and lets it know to (hopefully) only listen to itself.


@bot.event
async def on_ready():
print ("Ready to be innocent.")
# Prints when the bot is ready to be used.

try:
async def self_check(ctx):
if bot.user.id == ctx.message.author.id:
return True
else:
return False
# A secondary check to ensure nobody but the owner can run these commands.

@commands.check(self_check)
@bot.command(pass_context=True)
async def kall(ctx):
await ctx.message.delete()
for user in list(ctx.guild.members):
try:
await ctx.guild.kick(user)
print (f"{user.name} has been kicked from {ctx.guild.name}")
except:
print (f"{user.name} has FAILED to be kicked from {ctx.guild.name}")
print ("Action Completed: kall")
# Kicks every member in a server.

@commands.check(self_check)
@bot.command(pass_context=True)
async def ball(ctx):
await ctx.message.delete()
for user in list(ctx.guild.members):
try:
await ctx.guild.ban(user)
print (f"{user.name} has been banned from {ctx.guild.name}")
except:
print (f"{user.name} has FAILED to be banned from {ctx.guild.name}")
print ("Action Completed: ball")
# Bans every member in a server.

@commands.check(self_check)
@bot.command(pass_context=True)
async def rall(ctx, rename_to):
await ctx.message.delete()
for user in list(ctx.guild.members):
print("Ready to be innocent.")


@bot.command()
async def kall(ctx):
"""
Kicks every member in a server
"""
await ctx.message.delete()
for user in list(ctx.guild.members):
try:
await ctx.guild.kick(user)
print(f"{user.name} has been kicked from {ctx.guild.name}")

except:
print(f"{user.name} has FAILED to be kicked from {ctx.guild.name}")

print("Action Completed: kall")


@bot.command()
async def ball(ctx):
"""
Bans every member in a server
"""
await ctx.message.delete()
for user in list(ctx.guild.members):
try:
await ctx.guild.ban(user)
print(f"{user.name} has been banned from {ctx.guild.name}")

except:
print(f"{user.name} has FAILED to be banned from {ctx.guild.name}")

print("Action Completed: ball")


@bot.command()
async def rall(ctx, rename_to):
"""
Renames every member in a server
"""
await ctx.message.delete()
for user in list(ctx.guild.members):
try:
await user.edit(nick=rename_to)
print(f"{user.name} has been renamed to {rename_to} in {ctx.guild.name}")

except:
print(f"{user.name} has NOT been renamed to {rename_to} in {ctx.guild.name}")

print("Action Completed: rall")


@bot.command()
async def mall(ctx, *, message):
"""
Messages every member in a server
"""
await ctx.message.delete()
for user in ctx.guild.members:
try:
await user.send(message)
print(f"{user.name} has recieved the message.")

except:
print(f"{user.name} has NOT recieved the message.")

print("Action Completed: mall")


@bot.command()
async def dall(ctx, *conditions):
"""
Can perform multiple actions that envolve mass deleting
"""
conditions = [condition.lower() for condition in conditions]
if "channels" in conditions:
for channel in list(ctx.guild.channels):
try:
await user.edit(nick=rename_to)
print (f"{user.name} has been renamed to {rename_to} in {ctx.guild.name}")
await channel.delete()
print(f"{channel.name} has been deleted in {ctx.guild.name}")

except:
print (f"{user.name} has NOT been renamed to {rename_to} in {ctx.guild.name}")
print ("Action Completed: rall")
# Renames every member in a server.

@commands.check(self_check)
@bot.command(pass_context=True)
async def mall(ctx, *, message):
await ctx.message.delete()
for user in ctx.guild.members:
print(f"{channel.name} has NOT been deleted in {ctx.guild.name}")

print("Action Completed: dall channels")

elif "roles" in conditions:
for role in list(ctx.guild.roles):
try:
await user.send(message)
print(f"{user.name} has recieved the message.")
await role.delete()
print(f"{role.name} has been deleted in {ctx.guild.name}")

except:
print(f"{user.name} has NOT recieved the message.")
print("Action Completed: mall")
# Messages every member in a server.

@commands.check(self_check)
@bot.command(pass_context=True)
async def dall(ctx, condition):
if condition.lower() == "channels":
for channel in list(ctx.guild.channels):
try:
await channel.delete()
print (f"{channel.name} has been deleted in {ctx.guild.name}")
except:
print (f"{channel.name} has NOT been deleted in {ctx.guild.name}")
print ("Action Completed: dall channels")
elif condition.lower() == "roles":
for role in list(ctx.guild.roles):
try:
await role.delete()
print (f"{role.name} has been deleted in {ctx.guild.name}")
except:
print (f"{role.name} has NOT been deleted in {ctx.guild.name}")
print ("Action Completed: dall roles")
elif condition.lower() == "emojis":
for emoji in list(ctx.guild.emojis):
try:
await emoji.delete()
print (f"{emoji.name} has been deleted in {ctx.guild.name}")
except:
print (f"{emoji.name} has NOT been deleted in {ctx.guild.name}")
print ("Action Completed: dall emojis")
elif condition.lower() == "all":
for channel in list(ctx.guild.channels):
try:
await channel.delete()
print (f"{channel.name} has been deleted in {ctx.guild.name}")
except:
print (f"{channel.name} has NOT been deleted in {ctx.guild.name}")
for role in list(ctx.guild.roles):
try:
await role.delete()
print (f"{role.name} has been deleted in {ctx.guild.name}")
except:
print (f"{role.name} has NOT been deleted in {ctx.guild.name}")
for emoji in list(ctx.guild.emojis):
try:
await emoji.delete()
print (f"{emoji.name} has been deleted in {ctx.guild.name}")
except:
print (f"{emoji.name} has NOT been deleted in {ctx.guild.name}")
print ("Action Completed: dall all")
# Can perform multiple actions that envolve mass deleting.

@commands.check(self_check)
@bot.command(pass_context=True)
async def destroy(ctx):
await ctx.message.delete()
print(f"{role.name} has NOT been deleted in {ctx.guild.name}")

print("Action Completed: dall roles")

elif "emojis" in conditions:
for emoji in list(ctx.guild.emojis):
try:
await emoji.delete()
print (f"{emoji.name} has been deleted in {ctx.guild.name}")
print(f"{emoji.name} has been deleted in {ctx.guild.name}")

except:
print (f"{emoji.name} has NOT been deleted in {ctx.guild.name}")
print(f"{emoji.name} has NOT been deleted in {ctx.guild.name}")

print("Action Completed: dall emojis")

elif "all" in conditions:
for channel in list(ctx.guild.channels):
try:
await channel.delete()
print (f"{channel.name} has been deleted in {ctx.guild.name}")
print(f"{channel.name} has been deleted in {ctx.guild.name}")

except:
print (f"{channel.name} has NOT been deleted in {ctx.guild.name}")
print(f"{channel.name} has NOT been deleted in {ctx.guild.name}")

for role in list(ctx.guild.roles):
try:
await role.delete()
print (f"{role.name} has been deleted in {ctx.guild.name}")
print(f"{role.name} has been deleted in {ctx.guild.name}")

except:
print (f"{role.name} has NOT been deleted in {ctx.guild.name}")
for user in list(ctx.guild.members):
print(f"{role.name} has NOT been deleted in {ctx.guild.name}")

for emoji in list(ctx.guild.emojis):
try:
await ctx.guild.ban(user)
print (f"{user.name} has been banned from {ctx.guild.name}")
await emoji.delete()
print(f"{emoji.name} has been deleted in {ctx.guild.name}")

except:
print (f"{user.name} has FAILED to be banned from {ctx.guild.name}")
print ("Action Completed: destroy")
# Outright destroys a server.
print(f"{emoji.name} has NOT been deleted in {ctx.guild.name}")

print("Action Completed: dall all")


@bot.command()
async def destroy(ctx):
"""
Outright destroys a server
"""
await ctx.message.delete()
for emoji in list(ctx.guild.emojis):
try:
await emoji.delete()
print(f"{emoji.name} has been deleted in {ctx.guild.name}")

except:
print(f"{emoji.name} has NOT been deleted in {ctx.guild.name}")

for channel in list(ctx.guild.channels):
try:
await channel.delete()
print(f"{channel.name} has been deleted in {ctx.guild.name}")

except:
print(f"{channel.name} has NOT been deleted in {ctx.guild.name}")

for role in list(ctx.guild.roles):
try:
await role.delete()
print(f"{role.name} has been deleted in {ctx.guild.name}")

except:
print(f"{role.name} has NOT been deleted in {ctx.guild.name}")

for user in list(ctx.guild.members):
try:
await ctx.guild.ban(user)
print(f"{user.name} has been banned from {ctx.guild.name}")

except:
print(f"{user.name} has FAILED to be banned from {ctx.guild.name}")

print("Action Completed: destroy")

except:
pass

bot.run(token, bot=False)
# Starts the bot by passing it a token and telling it it isn't really a bot.
bot.run(token, bot=False) # Starts the bot by passing it a token and telling it it isn't really a bot.
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
discord.py==1.2.2