Skip to content
This repository has been archived by the owner on Jan 28, 2023. It is now read-only.

Commit

Permalink
feat: Profanity and Inclusive message check added (#87)
Browse files Browse the repository at this point in the history
* feat: alexjs config functionality

* feat: alexjs

* feat: alexjs config
  • Loading branch information
kkrishguptaa authored Oct 1, 2021
1 parent db61a45 commit d55108d
Show file tree
Hide file tree
Showing 4 changed files with 3,412 additions and 520 deletions.
31 changes: 9 additions & 22 deletions Commands/restrictedWords.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
const Discord = require('discord.js');
const alexjs = require('alex')
const config = require('../config.json').alexjs
const warnEmbed = new Discord.MessageEmbed()
.setColor('#f44336')
.setTitle('Community monitor warning you!!')
.setURL('https://github.com/kaiwalyakoparkar/classroom-monitor-bot')
.setAuthor(
'Classroon monitor',
'Classroom monitor',
'https://i.imgur.com/yMCOBLH.png',
'https://discord.js.org'
)
Expand Down Expand Up @@ -38,36 +40,21 @@ const words = [
'whitehatjunior'
]

const curseWords = [
'fuck',
'shit',
'bitch',
'asshole',
'ass',
'kys',
'kill your self',
'bastard',
'dick'
]

module.exports = (client, callback) => {
client.on('message', message => {
for (let i=0; i < words.length; i++) {
if(message.content.toLowerCase().includes(words[i])) {
for (let i = 0; i < words.length; i++) {
if (message.content.toLowerCase().includes(words[i])) {
message.author.send('Please do not talk about other edTech startups here 🚫. If you think I did a mistake dont worry I am still under development, tag Community Manager and report this 🏷️. ');
message.author.send(warnEmbed);
message.delete();
break;
}
}

for (let i = 0; i < curseWords.length; i++) {
if(message.content.toLowerCase().includes(curseWords[i])) {
message.author.send('Please do not use profane language 🚫. If you think I did a mistake dont worry I am still under development, tag Community Manager and report this 🏷️.');
message.author.send(warnEmbed);
message.delete();
break;
}
if (alexjs.markdown(message.content, config).messages.length) {
message.channel.send('Please do not use profane language 🚫. If you think I did a mistake dont worry I am still under development, tag Community Manager and report this 🏷️.', warnEmbed);
return;
}
});
};

13 changes: 11 additions & 2 deletions config.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
{
"prefix": "cm!"
}
"prefix": "cm!",
"alexjs": {
"allow": [
"he-she",
"her-him",
"gal-guy",
"dad-mom",
"brother-sister"
]
}
}
Loading

0 comments on commit d55108d

Please sign in to comment.