From 44ac5fe6dfbab21bb4c16ef580d1101167fd15fd Mon Sep 17 00:00:00 2001 From: Sugden <28943913+NotSugden@users.noreply.github.com> Date: Sat, 14 Mar 2020 12:39:54 +0000 Subject: [PATCH] =?UTF-8?q?fix(Util):=20cleanContent=20should=20remove=20m?= =?UTF-8?q?entions=20after=20formatting=E2=80=A6=20(#3936)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/util/Util.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/util/Util.js b/src/util/Util.js index ebade75157fd..c4fcf4826171 100644 --- a/src/util/Util.js +++ b/src/util/Util.js @@ -555,15 +555,6 @@ class Util { * @returns {string} */ static cleanContent(str, message) { - if (message.client.options.disableMentions === 'everyone') { - str = str.replace(/@([^<>@ ]*)/gmsu, (match, target) => { - if (target.match(/^[&!]?\d+$/)) { - return `@${target}`; - } else { - return `@\u200b${target}`; - } - }); - } str = str .replace(/<@!?[0-9]+>/g, input => { const id = input.replace(/<|!|>|@/g, ''); @@ -589,6 +580,15 @@ class Util { const role = message.guild.roles.cache.get(input.replace(/<|@|>|&/g, '')); return role ? `@${role.name}` : input; }); + if (message.client.options.disableMentions === 'everyone') { + str = str.replace(/@([^<>@ ]*)/gmsu, (match, target) => { + if (target.match(/^[&!]?\d+$/)) { + return `@${target}`; + } else { + return `@\u200b${target}`; + } + }); + } if (message.client.options.disableMentions === 'all') { return Util.removeMentions(str); } else {