From 15354ea108035f5652bed0e66fcec20edb6a8d13 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Thu, 28 Nov 2019 15:40:34 +0100 Subject: [PATCH] Show error message when image is too big --- commands/general/tweet.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/commands/general/tweet.js b/commands/general/tweet.js index ec2d89a8..05a00195 100644 --- a/commands/general/tweet.js +++ b/commands/general/tweet.js @@ -50,10 +50,10 @@ class tweetCommand extends Command { if (message.author.createdAt > date.setDate(date.getDate() - 7)) { return message.channel.send('Your account is too new to be able to use this command!'); } - - const client = this.client; - + if (!Attachment[0] && !args.text) return message.channel.send('You need to input something for me to tweet!'); + + const client = this.client; let T = new Twit({ consumer_key: twiConsumer, @@ -148,6 +148,7 @@ class tweetCommand extends Command { T.post('statuses/update', options, function (err, response) { if (err) { + if (err.code == 324) return message.channel.send(err.message); console.error('OH NO!!!!'); console.error(err); return message.channel.send('OH NO!!! AN ERROR HAS OCCURED!!! please hold on while i find what\'s causing this issue! '); @@ -179,7 +180,6 @@ class tweetCommand extends Command { channel = client.channels.get(twiChannel); channel.send({embed: Embed}); - return message.channel.send(`Go see ur epic tweet https://twitter.com/i/status/${tweetid}`); }); }