-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.ts
26 lines (20 loc) · 837 Bytes
/
app.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
import { Client } from 'discord.js';
import log from './app/utils/log';
import { intents } from './app/utils/discordIntents';
import { clientReadyEvent } from './app/events/clientReady';
import { errorEvent } from './app/events/error';
import { messageCreateEvent } from './app/events/messageCreate';
import { config } from './app/config/index.config';
// eslint-disable-next-line @typescript-eslint/no-floating-promises
(async (): Promise<void> => {
try {
log.info(`Starting ${config.get('app.name')} on ${config.get('app.env')} environment`);
const discordClient = new Client({ intents });
clientReadyEvent(discordClient);
messageCreateEvent(discordClient);
errorEvent(discordClient);
await discordClient.login(config.get('discord.token'));
} catch (error) {
log.error('Error:', error);
}
})();