diff --git a/structure/client/components/observers/Automoderation.js b/structure/client/components/observers/Automoderation.js index 5d72679..0680a6c 100644 --- a/structure/client/components/observers/Automoderation.js +++ b/structure/client/components/observers/Automoderation.js @@ -321,7 +321,7 @@ module.exports = class AutoModeration extends Observer { for (const reg of words) { - match = content.match(new RegExp(` ${reg} `, 'iu')); + match = content.match(new RegExp(`(?:^|\\s)${reg}`, 'iu')); if (match) break; @@ -337,7 +337,7 @@ module.exports = class AutoModeration extends Observer { `, // ** User:** <@${ author.id }> color: 15120384, fields: context.reverse().reduce((acc, val) => { - const text = val.content.length ? val.content.replace(match, '**__$&__**') : '**NO CONTENT**'; + const text = val.content.length ? Util.escapeMarkdown(val.content).replace(match, '**__$&__**') : '**NO CONTENT**'; acc.push({ name: `${val.author.tag} (${val.author.id}) - ${val.id}`, value: text.length < 1024 ? text : text.substring(0, 1013) + '...'