Skip to content

Commit

Permalink
Default Language
Browse files Browse the repository at this point in the history
  • Loading branch information
LoboMetalurgico committed Aug 11, 2020
1 parent da20bb6 commit 6d9d372
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
1 change: 1 addition & 0 deletions .Configs/general.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ module.exports = {
mongoose: '',
superUsersId: ['281515925960654848'], // Your User ID Comes Here!
language: 'br',
defaultLanguage: 'us',
sharding: {
totalShards: 'auto',
delay: 7500
Expand Down
2 changes: 1 addition & 1 deletion languages
2 changes: 1 addition & 1 deletion src/Events/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
6 changes: 4 additions & 2 deletions src/Events/ready.js
Original file line number Diff line number Diff line change
Expand Up @@ -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!');
Expand Down Expand Up @@ -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) {
Expand Down
5 changes: 3 additions & 2 deletions src/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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}`);
Expand All @@ -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) {
Expand Down

0 comments on commit 6d9d372

Please sign in to comment.