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