v2.1.0 push 7
Added LanguageManager.js (yep this is for language stuff in the future)
This commit is contained in:
@@ -2,6 +2,7 @@ const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
|
||||
|
||||
module.exports = () => {
|
||||
|
||||
@@ -2,6 +2,7 @@ const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
|
||||
const loadChalk = async () => {
|
||||
return await (await import("chalk")).default
|
||||
|
||||
@@ -0,0 +1,37 @@
|
||||
const index = require("../index")
|
||||
|
||||
if (index.developerMode){
|
||||
var config = require("../devConfig.json")
|
||||
}else{var config = require("../config.json")}
|
||||
|
||||
|
||||
var localLanguage = require("../language/english.json")
|
||||
if (config.languagefile.startsWith("custom")) localLanguage = require("../language/custom.json")
|
||||
else if (config.languagefile.startsWith("dutch")) localLanguage = require("../language/dutch.json")
|
||||
else if (config.languagefile.startsWith("english")) localLanguage = require("../language/english.json")
|
||||
else if (config.languagefile.startsWith("deutsch")) localLanguage = require("../language/deutsch.json")
|
||||
else if (config.languagefile.startsWith("french")) localLanguage = require("../language/french.json")
|
||||
|
||||
|
||||
const errorLog = async () => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
|
||||
console.log(chalk.red("Something went wrong when loading the language!")+"\nCheck the config file or create a ticket in our server!")
|
||||
}
|
||||
|
||||
const successLog = async () => {
|
||||
const chalk = await (await import("chalk")).default
|
||||
|
||||
console.log(chalk.green("loaded language file..."))
|
||||
}
|
||||
|
||||
if (!localLanguage){
|
||||
const runError = async () => {
|
||||
await errorLog()
|
||||
process.exit(1)
|
||||
}
|
||||
runError()
|
||||
}else{
|
||||
exports.language = localLanguage
|
||||
successLog()
|
||||
}
|
||||
@@ -3,7 +3,7 @@ const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const l = bot.language
|
||||
const storage = bot.storage
|
||||
|
||||
module.exports = async () => {
|
||||
|
||||
@@ -3,7 +3,7 @@ const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const l = bot.language
|
||||
const storage = bot.storage
|
||||
|
||||
/**
|
||||
|
||||
@@ -3,6 +3,7 @@ const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const getButton = require("./utils/getButton")
|
||||
const l = bot.language
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const getconfigoptions = require("./getoptions")
|
||||
|
||||
@@ -3,7 +3,7 @@ const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const log = bot.errorLog.log
|
||||
|
||||
const l = bot.language
|
||||
const storage = bot.storage
|
||||
|
||||
module.exports = () => {
|
||||
|
||||
@@ -2,6 +2,7 @@ const discord = require('discord.js')
|
||||
const bot = require('../index')
|
||||
const client = bot.client
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
|
||||
/**
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@ const discord = require("discord.js")
|
||||
const bot = require("../../index")
|
||||
const config = bot.config
|
||||
const getoptions = require("../getoptions")
|
||||
const l = bot.language
|
||||
|
||||
/**@returns {"DANGER"|"SUCCESS"|"PRIMARY"|"SECONDARY"} */
|
||||
const getColor = (color) => {
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
const bot = require("../../index")
|
||||
const config = bot.config
|
||||
const l = bot.language
|
||||
|
||||
exports.getTicketMessage = (input) => {
|
||||
var returned = config.messages.find(a => a.id == input)
|
||||
if (returned){
|
||||
|
||||
Reference in New Issue
Block a user