diff options
author | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-23 18:10:03 -0400 |
---|---|---|
committer | IRONM00N <64110067+IRONM00N@users.noreply.github.com> | 2021-10-23 18:10:03 -0400 |
commit | 8200a4427bb5c4093e7d4f1b30a3fdd7ee3380c1 (patch) | |
tree | 77bc547b2920a7a14cd47dc06a8a2b271588b2d7 | |
parent | 36ff682e742021918d134ff91a2bee3041b5a2b9 (diff) | |
parent | 9bc6ca4b2e42d8c55318710d115f3cdaeb5459eb (diff) | |
download | tanzanite-8200a4427bb5c4093e7d4f1b30a3fdd7ee3380c1.tar.gz tanzanite-8200a4427bb5c4093e7d4f1b30a3fdd7ee3380c1.tar.bz2 tanzanite-8200a4427bb5c4093e7d4f1b30a3fdd7ee3380c1.zip |
Merge branch 'master' of https://github.com/NotEnoughUpdates/bush-bot
-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 { |