forked from Adivise/NanoLab
-
Notifications
You must be signed in to change notification settings - Fork 0
/
nanolab.js
35 lines (29 loc) · 989 Bytes
/
nanolab.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
const { Client, Collection } = require("discord.js");
const { GenshinKit } = require('@genshin-kit/core');
class MainClient extends Client {
constructor() {
super({
shards: "auto",
intents: 32767,
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false
},
});
/// Handlers
this.config = require("./settings/config.js");
this.dev = this.config.DEV_ID;
this.genshin = new GenshinKit();
/// Check config
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());
["loadEvents", "loadCommands", "loadDatabases", "loadGenshin"].forEach(file => require(`./handlers/${file}`)(client));
}
connect() {
return super.login(this.token);
};
};
module.exports = MainClient;