-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
23 lines (18 loc) · 873 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
import Client from "./structures/Client";
import { IntentsBitField } from "discord.js";
const client = new Client({
intents: [ IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMessages, IntentsBitField.Flags.DirectMessages ]
});
require('dotenv').config()
client.login(process.env.TOKEN)
.then(async () => {
await client.logger.init(client);
client.logger.send(`[INDEX] Инициализация бота`);
(await import(`./handlers/events`)).default(client).catch(client.logger.error);
(await import(`./handlers/commands`)).default(client).catch(client.logger.error);
client.on('error', client.logger.error)
client.on('warn', client.logger.send)
process.on('uncaughtException', client.logger.error);
process.on('unhandledRejection', client.logger.error);
});
export default client;