-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
33 lines (24 loc) · 1021 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
30
31
32
33
import { Client, Collection, Events, GatewayIntentBits } from "discord.js";
import "dotenv/config";
import { ExtendedClient } from "./types/ExtendedClient";
import { loadCommands, registerSlashCommands } from "./handler/slashCommandHandler.js";
import { loadEvents } from "./handler/eventHandler.js";
import { Command } from "./types/Command.js";
const client: ExtendedClient = new Client({
intents:[
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.DirectMessageReactions,
GatewayIntentBits.DirectMessageTyping
]
}) as ExtendedClient;
// const rest = new REST({ version: '10' }).setToken(process.env.TOKEN as string);
client.commands = new Collection<string, Command>();
loadCommands(client);
loadEvents(client);
client.once(Events.ClientReady, async () => {
console.log(`Loading slashCommand for ${client.user!.tag}`);
await registerSlashCommands(client);
});
client.login(process.env.TOKEN);