From efe5e98ffa18c8da65ea495d1202fd7b057a806f Mon Sep 17 00:00:00 2001 From: Supositware Date: Sun, 24 Feb 2019 23:41:37 +0100 Subject: [PATCH] a basic swear filter and log the error --- commands/general/tweet.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/commands/general/tweet.js b/commands/general/tweet.js index 046652fd..7fa4c6c4 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -28,8 +28,15 @@ 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, '❤'); + console.log(text); + + text = rand.random(text, message); + + let client = new Twitter({ consumer_key: twiConsumer, consumer_secret: twiConsumerSecret, @@ -47,6 +54,7 @@ class tweetCommand extends Command { // Send the final text return message.channel.send(`Go see ur epic tweet https://twitter.com/HahaYesDB/status/${tweetid}`); } catch(err) { + console.error(err); return message.channel.send('Oh no, an error has occured :('); }