From 6d9d3729fd83ff2555d09b882671047552432414 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lobo=20Metal=C3=BArgico?= <43734867+LoboMetalurgico@users.noreply.github.com> Date: Mon, 10 Aug 2020 23:20:03 -0300 Subject: [PATCH] Default Language --- .Configs/general.js | 1 + languages | 2 +- src/Events/message.js | 2 +- src/Events/ready.js | 6 ++++-- src/main.js | 5 +++-- 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/.Configs/general.js b/.Configs/general.js index 21fbc48..da29556 100644 --- a/.Configs/general.js +++ b/.Configs/general.js @@ -22,6 +22,7 @@ module.exports = { mongoose: '', superUsersId: ['281515925960654848'], // Your User ID Comes Here! language: 'br', + defaultLanguage: 'us', sharding: { totalShards: 'auto', delay: 7500 diff --git a/languages b/languages index a9d8fd1..7d6e338 160000 --- a/languages +++ b/languages @@ -1 +1 @@ -Subproject commit a9d8fd1243a48f31c4fce9aa5d603ed1af70ba77 +Subproject commit 7d6e338ef461da261d18ef58bda481ad1f95f137 diff --git a/src/Events/message.js b/src/Events/message.js index 69cc020..f2f7ee8 100644 --- a/src/Events/message.js +++ b/src/Events/message.js @@ -47,7 +47,7 @@ exports.run = async (aruna, message) => { if (message.guild.region == 'brazil') { language = 'br'; } else { - language = config.language; + language = config.defaultLanguage; } console.log('No Server!'); var saveG = await new database.Guilds({ diff --git a/src/Events/ready.js b/src/Events/ready.js index ed765f4..530ff1f 100644 --- a/src/Events/ready.js +++ b/src/Events/ready.js @@ -20,7 +20,9 @@ const pkg = require('../../package.json'); const chalk = require('chalk'); -const { apiKeys, database } = require('../../Configs'); +const { apiKeys, config, database } = require('../../Configs'); + +const language = require(`../languages/bot/${config.language}/internal.json`); exports.run = async (aruna) => { log('Conectado!'); @@ -87,7 +89,7 @@ exports.run = async (aruna) => { }, 15000); function logPrefix() { - return `${chalk.gray('[')}${isSharded() ? `SHARD ${chalk.blue(aruna.shard.id)}` : aruna.user.username}${chalk.gray(']')}`; + return `${chalk.gray('[')}${isSharded() ? `${language.generic.shard} ${chalk.blue(aruna.shard.id)}` : aruna.user.username}${chalk.gray(']')}`; } function log(...a) { diff --git a/src/main.js b/src/main.js index 5b0bace..4eeca41 100644 --- a/src/main.js +++ b/src/main.js @@ -23,6 +23,7 @@ const Discord = require('discord.js'); const fs = require('fs'); const { config } = require('../Configs'); const chalk = require('chalk'); + const language = require(`../languages/bot/${config.language}/internal.json`); const aruna = new Discord.Client(); @@ -43,7 +44,7 @@ fs.readdir('./src/Commands/', (err, files) => { if (err) return error(`[${language.main.error}] => ${err}`); const jsfile = files.filter(f => f.split('.').pop() === 'js'); if (jsfile.length <= 0) { - return warn(`[${language.main.commands}] Not Found!`); + return warn(`[${language.main.commands}] ${language.generic.notFound}`); } jsfile.forEach(f => { const pull = require(`./Commands/${f}`); @@ -57,7 +58,7 @@ fs.readdir('./src/Commands/', (err, files) => { function logPrefix() { - return `${chalk.gray('[')}${isSharded() ? `SHARD ${chalk.blue(aruna.shard.id)}` : aruna.user.username}${chalk.gray(']')}`; + return `${chalk.gray('[')}${isSharded() ? `${language.generic.shard} ${chalk.blue(aruna.shard.id)}` : aruna.user.username}${chalk.gray(']')}`; } function log(...a) {