aboutsummaryrefslogtreecommitdiff
path: root/abwelcome.js
diff options
context:
space:
mode:
authorAlee14 <Alee14498@gmail.com>2017-08-17 17:45:26 -0400
committerAlee14 <Alee14498@gmail.com>2017-08-17 17:45:26 -0400
commitb51cf825f4f2afd830f4b472a7ce418a38274f86 (patch)
tree64275ecbda6c27b548d56f506111403d58b4e602 /abwelcome.js
parent26b58e83296077cbec7861519b54edab183d4a5b (diff)
downloadAleeBot-b51cf825f4f2afd830f4b472a7ce418a38274f86.tar.gz
AleeBot-b51cf825f4f2afd830f4b472a7ce418a38274f86.tar.bz2
AleeBot-b51cf825f4f2afd830f4b472a7ce418a38274f86.zip
Added a profanities filter!
Diffstat (limited to 'abwelcome.js')
-rw-r--r--abwelcome.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/abwelcome.js b/abwelcome.js
index 33214a8..0a54cf1 100644
--- a/abwelcome.js
+++ b/abwelcome.js
@@ -1,4 +1,5 @@
const Discord = require('discord.js');
+const profanities = require('profanities');
const client = new Discord.Client();
const config = require('./absettings.json');
@@ -18,6 +19,16 @@ client.on("guildMemberRemove", function(member) {
});
+client.on('message', message => {
+ for (x = 0; x < profanities.length; x++) {
+ if (message.content.toUpperCase() == profanities[x].toUpperCase()) {
+ message.reply('Hey! Don\'t say that word!')
+ message.delete();
+ return;
+ }
+ }
+});
+
process.on('unhandledRejection', function(err, p) {
console.log("[ERROR | UNCAUGHT PROMISE] " + err.stack);
});