Fix locale and eval limit + escaping

This commit is contained in:
Wessel T
2019-02-07 22:10:53 +01:00
parent d69898377e
commit 057e0fd851
2 changed files with 3 additions and 3 deletions

View File

@@ -36,13 +36,13 @@ module.exports = class Eval extends DiscordCommand {
catch (ex) { result = ex; errored = true; } catch (ex) { result = ex; errored = true; }
finally { finally {
if (silent) return message.edit(this.localize(msg.author.locale['developer']['eval']['silent'])); if (silent) return message.edit(this.localize(msg.author.locale['developer']['eval']['silent']));
result = this.sanitize(String(inspect(result))); result = this.bot.util.escapeMarkdown(this.sanitize(String(inspect(result))));
message.edit({ message.edit({
content: '', content: '',
embed: { embed: {
color : (errored ? this.bot.col['developer']['eval']['failure'] : this.bot.col['developer']['eval']['success']), color : (errored ? this.bot.col['developer']['eval']['failure'] : this.bot.col['developer']['eval']['success']),
description: this.localize(msg.author.locale['developer']['eval']['result'].join('\n'), { resultType: errored ? msg.author.locale['developer']['eval']['types'][1] : msg.author.locale['developer']['eval']['types'][0], resultMessage: this.bot.util.shorten(result, 1900) || '{}' }) description: this.localize(msg.author.locale['developer']['eval']['result'].join('\n'), { resultType: errored ? msg.author.locale['developer']['eval']['types'][1] : msg.author.locale['developer']['eval']['types'][0], resultMessage: this.bot.util.shorten(result, 1850) || '{}' })
} }
}); });
}; };

View File

@@ -20,7 +20,7 @@ module.exports = class LocaleRegistry {
if (f.startsWith('strings')) { if (f.startsWith('strings')) {
this.bot.locales.set(l['translation']['code'].toLowerCase(), l); this.bot.locales.set(l['translation']['code'].toLowerCase(), l);
this.bot.localeDic.push(l['translation']['code']); this.bot.localeDic.push(l['translation']['code']);
this.bot.localeMap.push(`${l['translation']['flag']} \`${l['translation']['code']}\` **:** ${l['translation']['orig']} (*${l['translation']['full']}*) \`[${l['translation']['progress']}%]\` {***${l['translation']['translator']['discord']['name']}#${l['translation']['translator']['discord']['discrim']}***}`); this.bot.localeMap.push(`${l['translation']['flag']} \`${l['translation']['code']}\` **:** ${l['translation']['orig']} (*${l['translation']['full']}*) \`[${l['translation']['progress']}%]\` {***${l['translation']['translator']['discord'][0]['name']}#${l['translation']['translator']['discord'][0]['discrim']}***}`);
} }
} }
} catch (ex) { } catch (ex) {