From 27244b686735951e0a5c31ee56318ffb2ff6f15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Bersier?= Date: Wed, 24 Jul 2019 00:52:37 +0200 Subject: [PATCH] If message is more than 280 characters send message to tell about it --- commands/general/tweet.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/commands/general/tweet.js b/commands/general/tweet.js index 6fc7401c..a43773a6 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -52,6 +52,10 @@ class tweetCommand extends Command { text = rand.random(text, message); + if (text.length > 280) { + return message.channel.send('Your message is more than the 280 characters limit!'); + } + try { let client = new Twitter({ consumer_key: twiConsumer,