-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.ts
28 lines (24 loc) · 898 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
import { GatewayIntentBits } from "discord.js";
import * as dotenvx from "@dotenvx/dotenvx";
import { readConfig } from "./src/config.js";
import { DatadropClient } from "./src/datadrop.js";
import type { Configuration } from "./src/models/Configuration.js";
dotenvx.config({ debug: Boolean(process.env.DEBUG), encoding: "utf-8" });
let client: DatadropClient;
readConfig()
.then(async (config: Configuration) => {
client = new DatadropClient(
{
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildVoiceStates,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages,
],
},
config,
);
await client.start();
})
.catch(() => client?.stop());