JaBa/index.js

29 lines
1.3 KiB
JavaScript
Raw Normal View History

2022-01-04 02:18:28 +05:00
require("./helpers/extenders");
const { GatewayIntentBits } = require("discord.js"),
2023-11-05 16:03:23 +05:00
Client = require("./base/Client");
2022-01-04 02:18:28 +05:00
2023-11-05 16:03:23 +05:00
const client = new Client({
2022-10-11 15:16:51 +05:00
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMembers, GatewayIntentBits.GuildBans, GatewayIntentBits.GuildEmojisAndStickers, GatewayIntentBits.GuildIntegrations, GatewayIntentBits.GuildInvites, GatewayIntentBits.GuildVoiceStates, GatewayIntentBits.GuildPresences, GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMessageReactions, GatewayIntentBits.GuildMessageTyping, GatewayIntentBits.MessageContent, GatewayIntentBits.DirectMessageTyping, GatewayIntentBits.DirectMessages, GatewayIntentBits.DirectMessageReactions ],
allowedMentions: { parse: ["everyone", "roles", "users"] },
2022-01-03 23:20:33 +05:00
});
2022-01-04 02:18:28 +05:00
(async () => {
2023-06-27 19:01:39 +05:00
console.time("botReady");
client.translations = await require("./helpers/languages")();
await client.loadEvents("../events");
await client.loadCommands("../commands");
await client.init();
})();
2022-01-04 02:18:28 +05:00
client
.on("disconnect", () => client.logger.warn("Bot is disconnecting..."))
.on("reconnecting", () => client.logger.warn("Bot reconnecting..."))
.on("warn", warn => client.logger.warn(warn))
.on("error", e => client.logger.error(`${e.message}\n${e.stack}`));
process
.on("unhandledRejection", e => console.log(e))
.on("uncaughtException", e => console.log(e));