diff options
| author | Unknown <Alee14498@gmail.com> | 2017-08-17 17:58:34 -0400 |
|---|---|---|
| committer | Unknown <Alee14498@gmail.com> | 2017-08-17 17:58:34 -0400 |
| commit | 03bb28ee58355914ddebb3a39792cb1c6d29a4ca (patch) | |
| tree | ee8be94c854f3daf18645db2f6870b7036f489c3 | |
| parent | ade322d9a7cfd23341ebe69bb1457df8c3fccfe6 (diff) | |
| parent | 1f244adbe81f478dfa992db66d9fd14344adeb9e (diff) | |
| download | AleeBot-03bb28ee58355914ddebb3a39792cb1c6d29a4ca.tar.gz AleeBot-03bb28ee58355914ddebb3a39792cb1c6d29a4ca.tar.bz2 AleeBot-03bb28ee58355914ddebb3a39792cb1c6d29a4ca.zip | |
Merge branch 'beta'
| -rw-r--r-- | abwelcome.js | 11 | ||||
| -rw-r--r-- | package.json | 3 |
2 files changed, 13 insertions, 1 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); }); diff --git a/package.json b/package.json index 30671c7..01356f8 100644 --- a/package.json +++ b/package.json @@ -5,8 +5,9 @@ "main": "aleebot.js", "dependencies": { "blessed": "^0.1.81", + "discord.js": "^11.1.0", "fs": "^0.0.1-security", - "discord.js": "^11.1.0" + "profanities": "^2.5.0" }, "devDependencies": {}, "scripts": { |
