-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmanager.js
38 lines (32 loc) · 1.14 KB
/
manager.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
const { Client, GatewayIntentBits, Collection } = require("discord.js");
const Discord = require('discord.js');
class MainClient extends Client {
constructor() {
super({
shards: 'auto',
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false
},
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
]
});
this.config = require("./plugins/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"].forEach(x => client[x] = new Collection());
["loadCommand", "loadEvent", "loadDatabase" ].forEach(x => require(`./handlers/${x}`)(client));
}
connect() {
return super.login(this.token);
};
};
module.exports = MainClient;