mcbot/index.js
2023-12-17 03:50:44 +11:00

27 lines
No EOL
690 B
JavaScript

console.time('Time to online');
require("dotenv").config();
const Discord = require("discord.js");
const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers], partials: [Discord.Partials.Channel] });
require('console-stamp')(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(handler => {
require(`./handlers/${handler}`)(client, Discord);
});
process.on('SIGINT', (code) => {
process.exit()
});
module.exports = {
client
}
client.login(process.env.BOT_TOKEN);