Had to use a new swear filter beacause it was insane

This commit is contained in:
Loic Bersier 2019-02-25 04:27:38 +01:00
parent 0a0f920196
commit 5d52f28d7a

View file

@ -1,6 +1,7 @@
const { Command } = require('discord-akairo'); const { Command } = require('discord-akairo');
const Twitter = require('twitter-lite'); const Twitter = require('twitter-lite');
const rand = require('../../rand.js'); const rand = require('../../rand.js');
const filter = require('leo-profanity');
const { twiConsumer, twiConsumerSecret, twiToken, twiTokenSecret, twiChannel } = require('../../config.json'); const { twiConsumer, twiConsumerSecret, twiToken, twiTokenSecret, twiChannel } = require('../../config.json');
const reload = require('auto-reload'); const reload = require('auto-reload');
@ -38,8 +39,9 @@ class tweetCommand extends Command {
if (!text) if (!text)
return; return;
//Basic filter, hopefully i wont get banned from twitter //Filter out swear word
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, '❤'); text = filter.clean(text);
console.log(text);
text = rand.random(text, message); text = rand.random(text, message);