-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathindex.ts
30 lines (24 loc) · 855 Bytes
/
index.ts
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
import {GatewayIntentBits} from "discord.js";
import ready from "./discord/listeners/ready";
import interactionCreate from "./discord/listeners/interactionCreate";
import {getEnv} from "./utils/GetEnv";
import {discordClient} from "./discord/discordClient";
import * as process from "process";
import {logMessage, messagePromise} from "./utils/logMessage";
import serverJoin from "./discord/listeners/serverJoin";
(async () => {
ready(discordClient);
interactionCreate(discordClient);
serverJoin(discordClient);
const botToken = getEnv('BOT_TOKEN');
console.log("Bot is starting...");
if (!botToken) {
throw new Error('NO BOT TOKEN');
}
global
.process
.on('uncaughtException', e => {
logMessage('uncaughtException:', e);
});
await discordClient.login(botToken);
})();