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,
|
|
|
|
],
|
2022-12-15 21:02:38 +05:00
|
|
|
allowedMentions: { parse: ["everyone", "roles", "users"] },
|
2022-01-03 23:20:33 +05:00
|
|
|
});
|
2022-01-04 02:18:28 +05:00
|
|
|
|
2022-07-23 17:14:42 +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();
|
2022-07-26 17:20:10 +05:00
|
|
|
|
2022-07-23 17:14:42 +05:00
|
|
|
await client.loadEvents("../events");
|
2022-07-26 19:46:32 +05:00
|
|
|
await client.loadCommands("../commands");
|
2022-07-23 17:14:42 +05:00
|
|
|
await client.init();
|
|
|
|
})();
|
2022-01-04 02:18:28 +05:00
|
|
|
|
2024-02-06 21:45:53 +05:00
|
|
|
client
|
2024-08-14 18:52:46 +05:00
|
|
|
.on("disconnect", () => client.logger.warn("Bot disconnected."))
|
2024-02-06 21:45:53 +05:00
|
|
|
.on("reconnecting", () => client.logger.warn("Bot reconnecting..."))
|
2024-08-14 18:52:46 +05:00
|
|
|
.on("warn", console.log)
|
|
|
|
.on("error", console.log);
|
2024-02-06 21:45:53 +05:00
|
|
|
|
2024-12-05 19:16:01 +05:00
|
|
|
process.on("unhandledRejection", e => console.log(e)).on("uncaughtException", e => console.log(e));
|