From 0491dee1f84791e48c312ce0659a91df55ddce75 Mon Sep 17 00:00:00 2001 From: "Navy.gif" Date: Thu, 13 Jan 2022 21:46:47 +0200 Subject: [PATCH] support for emoji formatting --- src/structure/client/LocaleLoader.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/structure/client/LocaleLoader.js b/src/structure/client/LocaleLoader.js index ef941a1..dca4c6f 100644 --- a/src/structure/client/LocaleLoader.js +++ b/src/structure/client/LocaleLoader.js @@ -3,6 +3,7 @@ const fs = require('fs'); const chalk = require('chalk'); const Util = require('../../Util.js'); +const { Emojis } = require('../../constants/index.js'); class LocaleLoader { @@ -27,7 +28,9 @@ class LocaleLoader { if (!this.languages[language]) return `< Missing Locale: ${language} >`; let string = this.languages[language][index]; - if(!string) return `< Missing Locale Index: ${language}.${index} >`; + if (!string) return `< Missing Locale Index: ${language}.${index} >`; + + for (const emoji of Object.keys(Emojis)) parameters[`emoji_${emoji}`] = Emojis[emoji]; for(const [ parameter, value ] of Object.entries(parameters)) { string = string.replace(new RegExp(Util.escapeRegex(`{${parameter.toLowerCase()}}`), 'giu'), value);