forked from Noritem/keyauthbot
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.js
24 lines (16 loc) · 1.34 KB
/
main.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
const { Client, Intents, Collection } = require('discord.js')
const { MessageEmbed } = require('discord.js')
const client = new Client({
partials: ['CHANNEL', 'USER', 'GUILD_MEMBER', 'MESSAGE',"GUILDS", "GUILD_MEMBERS", "GUILD_BANS", "GUILD_EMOJIS_AND_STICKERS", "GUILD_INTEGRATIONS", "GUILD_WEBHOOKS", "GUILD_INVITES", "GUILD_VOICE_STATES", "GUILD_PRESENCES", "GUILD_MESSAGES", "GUILD_MESSAGE_REACTIONS", "GUILD_MESSAGE_TYPING", "DIRECT_MESSAGES", "DIRECT_MESSAGE_REACTIONS", "DIRECT_MESSAGE_TYPING"],
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES, Intents.FLAGS.GUILD_MEMBERS, Intents.FLAGS.GUILD_MESSAGE_REACTIONS, Intents.FLAGS.GUILD_PRESENCES, Intents.FLAGS.GUILD_VOICE_STATES, Intents.FLAGS.GUILD_BANS, Intents.FLAGS.GUILD_EMOJIS_AND_STICKERS, Intents.FLAGS.GUILD_INTEGRATIONS, Intents.FLAGS.GUILD_WEBHOOKS, Intents.FLAGS.GUILD_INVITES, Intents.FLAGS.GUILD_MESSAGE_TYPING, Intents.FLAGS.DIRECT_MESSAGE_REACTIONS, Intents.FLAGS.DIRECT_MESSAGE_TYPING],
})
require('dotenv').config()
client.slashCommands = new Collection()
client.cooldowns = new Collection();
['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)