-
Notifications
You must be signed in to change notification settings - Fork 15
/
index.js
35 lines (30 loc) · 1.03 KB
/
index.js
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
import dotenv from 'dotenv';
dotenv.config();
import Discord from 'discord.js';
import consoleStamp from 'console-stamp';
const client = new Discord.Client({
intents: [
Discord.GatewayIntentBits.Guilds,
Discord.GatewayIntentBits.GuildMembers,
Discord.GatewayIntentBits.GuildModeration,
Discord.GatewayIntentBits.GuildWebhooks,
Discord.GatewayIntentBits.GuildInvites,
Discord.GatewayIntentBits.GuildPresences,
Discord.GatewayIntentBits.GuildMessages,
Discord.GatewayIntentBits.MessageContent,
],
partials: [
Discord.Partials.Channel,
],
});
console.time('Time to online');
consoleStamp(console, {
format: ':date(dd mmmm yyyy HH:MM:ss) :label',
});
client.commands = new Discord.Collection();
client.events = new Discord.Collection();
['command_handler', 'event_handler'].forEach(async (handler) => {
await import(`./handlers/client/${handler}.js`)
.then(module => { module.default(client, Discord); });
});
client.login(process.env.BOT_TOKEN);