diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/badwords.ts | 36 | ||||
-rw-r--r-- | src/lib/common/AutoMod.ts | 14 |
2 files changed, 47 insertions, 3 deletions
diff --git a/src/lib/badwords.ts b/src/lib/badwords.ts index e5033d7..1773274 100644 --- a/src/lib/badwords.ts +++ b/src/lib/badwords.ts @@ -9,60 +9,70 @@ export default { ignoreSpaces: true, ignoreCapitalization: true, reason: "racial slur", + regex: false, }, "nigga": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "racial slur", + regex: false, }, "nigger": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "racial slur", + regex: false, }, "nigra": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "racial slur", + regex: false, }, "retard": { severity: Severity.TEMP_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "ableist slur", + regex: false, }, "retarted": { severity: Severity.TEMP_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "ableist slur", + regex: false, }, "slut": { severity: Severity.WARN, ignoreSpaces: false, ignoreCapitalization: true, reason: "derogatory term", + regex: false, }, "tar baby": { severity: Severity.TEMP_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "racial slur", + regex: false, }, "whore": { severity: Severity.WARN, ignoreSpaces: false, ignoreCapitalization: true, reason: "derogatory term", + regex: false, }, "卍": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "racist symbol", + regex: false, }, /* -------------------------------------------------------------------------- */ @@ -74,72 +84,84 @@ export default { ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hello i am leaving cs:go": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hello! I'm done with csgo": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hi bro, i'm leaving this fucking game, take my skin": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hi friend, today i am leaving this fucking game": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hi guys, i'm leaving this fucking game, take my": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hi, bro h am leaving cs:go and giving away my skin": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "hi, bro i am leaving cs:go and giving away my skin": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "i confirm all exchanges, there won't be enough": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "i quit csgo": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "the first three who send a trade": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, "you can choose any skin for yourself": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "steam scam phrase", + regex: false, }, /* -------------------------------------------------------------------------- */ @@ -150,54 +172,63 @@ export default { ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "discord nitro for free - steam store": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "free 3 months of discord nitro": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "free discord nitro airdrop": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "get 3 months of discord nitro": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "get discord nitro for free": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "get free discord nitro from steam": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "lol, jahjajha free discord nitro for 3 month!!": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "steam is giving away 3 months of discord nitro for free to all no limited steam users": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "Лол, бесплатный дискорд нитро на 1 месяц!": { //? Lol, 1 month free discord nitro! @@ -205,12 +236,14 @@ export default { ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, "Airdrop Discord FREE NITRO from Steam —": { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, reason: "discord nitro scam phrase", + regex: false, }, /* -------------------------------------------------------------------------- */ @@ -221,6 +254,7 @@ export default { ignoreSpaces: true, ignoreCapitalization: true, reason: "misc. scam phrase", + regex: false, }, "there is a possible chance tomorrow there will be a cyber-attack event where on all social networks including Discord there will be people trying": { @@ -228,6 +262,7 @@ export default { ignoreSpaces: false, ignoreCapitalization: true, reason: "annoying copy pasta", + regex: false, }, /* -------------------------------------------------------------------------- */ @@ -238,5 +273,6 @@ export default { ignoreSpaces: true, ignoreCapitalization: true, reason: "blacklisted server link", + regex: false, }, } as BadWords; diff --git a/src/lib/common/AutoMod.ts b/src/lib/common/AutoMod.ts index 312beb3..adc629a 100644 --- a/src/lib/common/AutoMod.ts +++ b/src/lib/common/AutoMod.ts @@ -29,7 +29,8 @@ export class AutoMod { severity: Severity.PERM_MUTE, ignoreSpaces: true, ignoreCapitalization: true, - reason: 'malicious link' + reason: 'malicious link', + regex: false }; }); @@ -67,8 +68,14 @@ export class AutoMod { const matchedWords: BadWords = {}; for (const word in words) { const wordOptions = words[word]; - if (this.format(this.message.content, wordOptions).includes(this.format(word, wordOptions))) { - matchedWords[word] = wordOptions; + if (wordOptions.regex) { + if (new RegExp(word).test(this.format(word, wordOptions))) { + matchedWords[word] = wordOptions; + } + } else { + if (this.format(this.message.content, wordOptions).includes(this.format(word, wordOptions))) { + matchedWords[word] = wordOptions; + } } } return matchedWords; @@ -239,6 +246,7 @@ interface BadWordDetails { ignoreSpaces: boolean; ignoreCapitalization: boolean; reason: string; + regex: boolean; } export interface BadWords { |