Skip to content

Commit

Permalink
add language exceptions
Browse files Browse the repository at this point in the history
  • Loading branch information
Glazelf committed Sep 8, 2021
1 parent 3476825 commit 26775c9
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions util/autoMod.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,15 @@ module.exports = async (client, message, language) => {
let messageContentBlock = "";
if (message.content.length > 0) messageContentBlock = Discord.Formatters.codeBlock(message.content);

let russianLinks = new RegExp(".*http(.)?:\/\/[^\s]*\.ru.*", "i");

const scamLinks = [
".*http(.)?:\/\/(dicsord-nitro|steamnitro|discordgift|discorcl)\.(com|org|ru|click).*", // Discord gift links
".*http(.)?:\/\/[^\s]*\.ru.*" // Russian websites, should disable this for russian discords lol
russianLinks // Russian websites, should disable this for russian discords lol
];
let scamRegex = new RegExp(scamLinks.join("|"), "i");


const adLinks = [
"discord.gg",
"bit.ly",
Expand All @@ -39,7 +42,7 @@ module.exports = async (client, message, language) => {
];
let slurRegex = new RegExp(globalSlurs.join("|"), "i");

// Language exceptions currently unused
// Language exceptions
const exceptionsFrench = [
"retard"
];
Expand All @@ -57,6 +60,9 @@ module.exports = async (client, message, language) => {

// Scam links
if (scamRegex.test(messageNormalized)) {
if (language = "ru") {
if (russianLinks.test(messageNormalized)) return false;
};
reason = "Posting scam links.";
await ban();
return true;
Expand Down

0 comments on commit 26775c9

Please sign in to comment.