v2.1.0 push 7

Added LanguageManager.js (yep this is for language stuff in the future)
This commit is contained in:
DJj123dj
2022-06-21 12:11:09 +02:00
parent 09f9944cf7
commit 9d19c7053b
21 changed files with 61 additions and 9 deletions
+1
View File
@@ -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 = () => {
+1
View File
@@ -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
+37
View File
@@ -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()
}
+1 -1
View File
@@ -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 () => {
+1 -1
View File
@@ -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
/**
+1
View File
@@ -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
/**
*
+1
View File
@@ -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")
+1 -1
View File
@@ -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 = () => {
+1
View File
@@ -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
/**
*
+1
View File
@@ -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) => {
+2
View File
@@ -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){