-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
24 lines (21 loc) · 788 Bytes
/
bot.js
File metadata and controls
24 lines (21 loc) · 788 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
require('dotenv').config();
const { Client, GatewayIntentBits, Collection } = require('discord.js');
const { loadCommands } = require('./handlers/commandLoader');
const { loadEvents } = require('./handlers/eventLoader');
const { registerCommands } = require('./registerCommands'); // Impor registerCommands
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers
]
});
client.commands = new Collection();
// Load commands and events
loadEvents(client);
loadCommands(client);
client.login(process.env.DISCORD_TOKEN).then(() => {
// Daftarkan slash commands setelah bot login
registerCommands(client);
});