JaBa/index.js

45 lines
1.3 KiB
JavaScript
Raw Normal View History

2024-12-05 19:16:01 +05:00
import "./helpers/extenders.js";
2022-01-04 02:18:28 +05:00
2024-12-05 19:16:01 +05:00
import { GatewayIntentBits } from "discord.js";
2024-12-05 20:15:07 +05:00
import JaBaClient from "./base/Client.js";
import languages from "./helpers/languages.js";
2022-01-04 02:18:28 +05:00
2024-12-05 20:15:07 +05:00
const client = new JaBaClient({
2024-12-05 19:16:01 +05:00
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers,
GatewayIntentBits.GuildModeration,
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");
2024-12-05 20:15:07 +05:00
client.translations = await 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 disconnected."))
.on("reconnecting", () => client.logger.warn("Bot reconnecting..."))
.on("warn", console.log)
.on("error", console.log);
2024-12-05 19:16:01 +05:00
process.on("unhandledRejection", e => console.log(e)).on("uncaughtException", e => console.log(e));