refactor: fix i18n debug being true on production

This commit is contained in:
Jonny_Bro (Nikita) 2024-12-12 20:55:11 +05:00
parent 62ab9250fc
commit 30a83aa273
2 changed files with 8 additions and 44 deletions

View file

@ -1,11 +1,6 @@
// import "./helpers/extenders.js";
// import { GatewayIntentBits } from "discord.js";
// import JaBaClient from "./base/Client.js";
// import languages from "./helpers/languages.js";
import { GatewayIntentBits } from "discord.js"; import { GatewayIntentBits } from "discord.js";
import { ExtendedClient } from "./structures/client.js"; import { ExtendedClient } from "./structures/client.js";
import logger from "./helpers/logger.js";
export const client = new ExtendedClient({ export const client = new ExtendedClient({
intents: [ intents: [
@ -30,41 +25,10 @@ export const client = new ExtendedClient({
client.init(); client.init();
// const client = new JaBaClient({ client
// intents: [ .on("disconnect", () => logger.warn("Bot disconnected."))
// GatewayIntentBits.Guilds, .on("reconnecting", () => logger.warn("Bot reconnecting..."))
// GatewayIntentBits.GuildMembers, .on("warn", console.log)
// GatewayIntentBits.GuildModeration, .on("error", console.log);
// 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"] },
// });
// (async () => { process.on("unhandledRejection", console.log).on("uncaughtException", console.log);
// console.time("botReady");
// client.translations = await languages();
// await client.loadEvents("../events");
// await client.loadCommands("../commands");
// await client.init();
// })();
// client
// .on("disconnect", () => client.logger.warn("Bot disconnected."))
// .on("reconnecting", () => client.logger.warn("Bot reconnecting..."))
// .on("warn", console.log)
// .on("error", console.log);
// process.on("unhandledRejection", e => console.log(e)).on("uncaughtException", e => console.log(e));

View file

@ -51,7 +51,7 @@ export default class InternationalizationService {
backend: { backend: {
loadPath: resolve(this.options.localesPath, "./{{lng}}/{{ns}}.json"), loadPath: resolve(this.options.localesPath, "./{{lng}}/{{ns}}.json"),
}, },
debug: this.client.configService.get("production") ? true : false, debug: this.client.configService.get("production") ? false : true,
fallbackLng: this.options.defaultLanguage, fallbackLng: this.options.defaultLanguage,
preload: languages, preload: languages,
ns: namespaces, ns: namespaces,