-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
34 lines (24 loc) · 810 Bytes
/
index.js
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
31
32
33
34
import { config } from "dotenv";
import { Client, Collection, GatewayIntentBits, Partials } from "discord.js";
import { penaltyScheduler } from "./utils/scheduler.js";
import * as commands from "./commands/index.js";
import * as events from "./events/index.js";
config();
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
],
partials: [Partials.Message, Partials.Reaction, Partials.User],
});
const token = process.env.DISCORD_TOKEN;
client.commands = new Collection();
Object.keys(commands).forEach((key) => {
client.commands.set(commands[key].data.name, commands[key]);
});
Object.keys(events).forEach((key) => {
events[key](client);
});
penaltyScheduler().start();
client.login(token);