use Util methods for escaping inline code and code blocks

This commit is contained in:
almeidx 2021-07-29 17:35:27 +01:00
parent 5e91a9fed3
commit 5de35f711d
No known key found for this signature in database
GPG key ID: 8558FBFF849BD664
11 changed files with 36 additions and 55 deletions

View file

@ -1,6 +1,6 @@
import { Util } from "discord.js";
import escapeStringRegexp from "escape-string-regexp";
import * as t from "io-ts";
import { disableInlineCode } from "../../../utils";
import { normalizeText } from "../../../utils/normalizeText";
import { stripMarkdown } from "../../../utils/stripMarkdown";
import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary";
@ -89,6 +89,6 @@ export const MatchWordsTrigger = automodTrigger<MatchResultType>()({
renderMatchInformation({ pluginData, contexts, matchResult }) {
const partialSummary = getTextMatchPartialSummary(pluginData, matchResult.extra.type, contexts[0]);
return `Matched word \`${disableInlineCode(matchResult.extra.word)}\` in ${partialSummary}`;
return `Matched word \`${Util.escapeInlineCode(matchResult.extra.word)}\` in ${partialSummary}`;
},
});