diff options
-rw-r--r-- | src/lib/badwords.ts | 108 | ||||
-rw-r--r-- | src/lib/common/AutoMod.ts | 15 |
2 files changed, 84 insertions, 39 deletions
diff --git a/src/lib/badwords.ts b/src/lib/badwords.ts index e5033d7..f878f45 100644 --- a/src/lib/badwords.ts +++ b/src/lib/badwords.ts @@ -9,61 +9,71 @@ 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, +}, /* -------------------------------------------------------------------------- */ /* Steam Scams */ @@ -74,73 +84,85 @@ 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, +}, /* -------------------------------------------------------------------------- */ /* Nitro Scams */ @@ -150,68 +172,79 @@ 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! severity: Severity.PERM_MUTE, 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, +}, /* -------------------------------------------------------------------------- */ /* Misc Scams */ @@ -221,14 +254,16 @@ 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": { severity: Severity.WARN, ignoreSpaces: false, ignoreCapitalization: true, reason: "annoying copy pasta", - }, + regex: false, +}, /* -------------------------------------------------------------------------- */ /* Frequently Advertised Discord Severs */ @@ -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..5f0b8a0 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,15 @@ 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 +247,7 @@ interface BadWordDetails { ignoreSpaces: boolean; ignoreCapitalization: boolean; reason: string; + regex: boolean; } export interface BadWords { |