3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-10 20:35:02 +00:00

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,7 +1,8 @@
import { Util } from "discord.js";
import escapeStringRegexp from "escape-string-regexp";
import * as t from "io-ts";
import { allowTimeout } from "../../../RegExpRunner";
import { disableInlineCode, getUrlsInString, tNullable } from "../../../utils";
import { getUrlsInString, tNullable } from "../../../utils";
import { TRegex } from "../../../validatorUtils";
import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary";
import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage";
@ -129,6 +130,6 @@ export const MatchLinksTrigger = automodTrigger<MatchResultType>()({
renderMatchInformation({ pluginData, contexts, matchResult }) {
const partialSummary = getTextMatchPartialSummary(pluginData, matchResult.extra.type, contexts[0]);
return `Matched link \`${disableInlineCode(matchResult.extra.link)}\` in ${partialSummary}`;
return `Matched link \`${Util.escapeInlineCode(matchResult.extra.link)}\` in ${partialSummary}`;
},
});