-
-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmain.js
More file actions
19 lines (18 loc) · 732 Bytes
/
main.js
File metadata and controls
19 lines (18 loc) · 732 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
const { Client, Intents, Collection } = require('discord.js')
const client = new Client({
partials: ['CHANNEL', 'USER', 'GUILD_MEMBER', 'MESSAGE'],
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES],
})
require('dotenv').config()
client.commands = new Collection()
client.buttons = new Collection()
client.selectMenus = new Collection()
client.slashCommands = new Collection()
client.cooldowns = new Collection();
['commandHandler.js', 'interactionHandler.js', 'eventHandler.js'].forEach((handler) => {
require(`./handlers/${handler}`)(client)
})
process.on('unhandledRejection', error => {
console.error('Unhandled promise rejection:', error);
});
client.login(process.env.BOT_TOKEN)