-
Notifications
You must be signed in to change notification settings - Fork 0
/
MC_Server_Track.js
40 lines (33 loc) · 1.03 KB
/
MC_Server_Track.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
const { Client, GatewayIntentBits, Partials, Collection } = require("discord.js");
require('dotenv').config();
require('module-alias/register');
const { initWebserver } = require("./handyFunctions");
const client = new Client({
partials: [
Partials.Message,
Partials.Channel,
Partials.Reaction,
],
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildEmojisAndStickers,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.GuildPresences,
]
});
const { Log } = require("@root/logSystem");
Log.configure(client, process.env.logchannel);
const token = process.env.token;
console.log(`Node version: ${process.version}`)
initWebserver(client); //Start a web server
client.commands = new Collection();
["command_handler", "event_handler"].forEach(handler => {
require(`./handlers/${handler}.js`)(client);
});
client.login(token).catch((err) => {
console.log("That's an invalid token I fear :(");
process.exit(1);
});