From 5d52f28d7af2d3c00b7a801008ef93329731e471 Mon Sep 17 00:00:00 2001 From: Loic Bersier Date: Mon, 25 Feb 2019 04:27:38 +0100 Subject: [PATCH] Had to use a new swear filter beacause it was insane --- commands/general/tweet.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/general/tweet.js b/commands/general/tweet.js index 5f46c59..7718f99 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -1,6 +1,7 @@ const { Command } = require('discord-akairo'); const Twitter = require('twitter-lite'); const rand = require('../../rand.js'); +const filter = require('leo-profanity'); const { twiConsumer, twiConsumerSecret, twiToken, twiTokenSecret, twiChannel } = require('../../config.json'); const reload = require('auto-reload'); @@ -38,8 +39,9 @@ class tweetCommand extends Command { if (!text) return; - //Basic filter, hopefully i wont get banned from twitter - text = text.replace(/n[\w\W]+gg[\w\W]+|f[aA\W*-_0-9]gg[\w\W]+|f[aA\W*-_0-9]g|kys/gi, '❤'); + //Filter out swear word + text = filter.clean(text); + console.log(text); text = rand.random(text, message);