Update Translator.plugin.js

This commit is contained in:
Mirco Wittrien 2023-02-22 09:11:54 +01:00 committed by GitHub
parent e7db29b90c
commit ccb2d7852b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@
* @name Translator
* @author DevilBro
* @authorId 278543574059057154
* @version 2.5.1
* @version 2.5.2
* @description Allows you to translate Messages and your outgoing Messages within Discord
* @invite Jx3TjNS
* @donate https://www.paypal.me/MircoWittrien
@ -1315,7 +1315,7 @@ module.exports = (_ => {
addExceptions (string, excepts) {
for (let count in excepts) {
let exception = BDFDB.ArrayUtils.is(this.settings.exceptions.wordStart) && this.settings.exceptions.wordStart.some(n => excepts[count].indexOf(n) == 0) ? excepts[count].slice(1) : excepts[count];
let newString = string.replace(new RegExp(BDFDB.StringUtils.regEscape(`{{${count}}}`)), exception);
let newString = string.replace(new RegExp(BDFDB.StringUtils.regEscape(`{\s*{\s*${count}\s*}\s*}`)), exception);
if (newString == string) string = newString + " " + exception;
else string = newString;
}