-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathnanolab.js
39 lines (33 loc) · 1.24 KB
/
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
36
37
38
39
const { Client, Collection, GatewayIntentBits } = require("discord.js");
const { GenshinKit } = require('@genshin-kit/core');
class MainClient extends Client {
constructor() {
super({
shards: "auto",
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.MessageContent,
]
});
/// Handlers
this.config = require("./settings/config.js");
this.owner = this.config.OWNER_ID;
this.dev = this.config.DEV_ID;
this.color = this.config.EMBED_COLOR;
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());
["loadEvent", "loadCommand", "loadDatabase"].forEach(file => require(`./handlers/${file}`)(client));
}
connect() {
return super.login(this.token);
};
};
module.exports = MainClient;