forked from LAION-AI/Open-Assistant
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.ts
41 lines (38 loc) · 1.06 KB
/
bot.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
34
35
36
37
38
39
40
41
// Require the necessary discord.js classes
import {
Client,
Collection,
GatewayIntentBits,
REST,
Partials,
} from "discord.js";
import "dotenv/config";
import eventHandler from "./handlers/events.js";
import commandHandler from "./handlers/commands.js";
import interactionsHandler from "./handlers/interactions.js";
// Create a new client instance
const client: any = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMessageReactions,
GatewayIntentBits.DirectMessages,
GatewayIntentBits.GuildVoiceStates,
],
partials: [
Partials.User, // We want to receive uncached users!
Partials.Channel,
Partials.Message,
],
});
const rest = new REST({ version: "10" }).setToken(process.env.TOKEN);
client.commands = new Collection();
client.interactions = new Collection();
client.tasks = [];
client.version = "1.0.0";
// Handlers
eventHandler(client);
commandHandler(client);
interactionsHandler(client);
// Log in to Discord with your client's token
client.login(process.env.TOKEN);