forked from SrWitty/Space-Plus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
bot.js
37 lines (30 loc) · 1.18 KB
/
bot.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
const { Client, GatewayIntentBits, Collection } = require("discord.js");
class MainClient extends Client {
constructor() {
super({
shards: "auto",
allowedMentions: { parse: ["users", "roles"] },
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
]
});
this.config = require("./Settings/config.js");
this.owner = this.config.OWNER_ID;
this.dev = this.config.DEV_ID;
this.color = this.config.EMBED_COLOR;
if(!this.token) this.token = this.config.TOKEN;
process.on('unhandledRejection', error => console.log(error));
process.on('uncaughtException', error => console.log(error));
const client = this;
["slash", "premiums"].forEach(x => client[x] = new Collection());
["Command", "errLogger","Events", "Database",].forEach(x => require(`./Handler/${x}`)(client));
}
connect() {
return super.login(this.token);
};
};
module.exports = MainClient;