Replace transliteration package use with a custom normalizer function
Huge thanks to Nobody#6075 for doing most of the work for it!
This commit is contained in:
parent
ceb567ad9a
commit
925cf718e7
6 changed files with 207 additions and 42 deletions
|
@ -1,11 +1,11 @@
|
|||
import * as t from "io-ts";
|
||||
import { transliterate } from "transliteration";
|
||||
import { automodTrigger } from "../helpers";
|
||||
import { disableInlineCode, verboseChannelMention } from "../../../utils";
|
||||
import { MatchableTextType, matchMultipleTextTypesOnMessage } from "../functions/matchMultipleTextTypesOnMessage";
|
||||
import { getTextMatchPartialSummary } from "../functions/getTextMatchPartialSummary";
|
||||
import { allowTimeout } from "../../../RegExpRunner";
|
||||
import { TRegex } from "../../../validatorUtils";
|
||||
import { normalizeText } from "../../../utils/normalizeText";
|
||||
|
||||
interface MatchResultType {
|
||||
pattern: string;
|
||||
|
@ -43,7 +43,7 @@ export const MatchRegexTrigger = automodTrigger<MatchResultType>()({
|
|||
|
||||
for await (let [type, str] of matchMultipleTextTypesOnMessage(pluginData, trigger, context.message)) {
|
||||
if (trigger.normalize) {
|
||||
str = transliterate(str);
|
||||
str = normalizeText(str);
|
||||
}
|
||||
|
||||
for (const sourceRegex of trigger.patterns) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue