From 3873ba86de486c4c3ed51545d68643c9dae12c69 Mon Sep 17 00:00:00 2001
From: loicbersier <loic.bersier1@gmail.com>
Date: Wed, 18 Mar 2020 18:26:36 +0100
Subject: [PATCH] Check for message first

---
 commands/general/tweet.js | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/commands/general/tweet.js b/commands/general/tweet.js
index d5a80df7..ad508d93 100644
--- a/commands/general/tweet.js
+++ b/commands/general/tweet.js
@@ -31,8 +31,10 @@ class tweetCommand extends Command {
 	}
 
 	async exec(message, args) {
-		let date = new Date();
 		let Attachment = (message.attachments).array();
+		if (!Attachment[0] && !args.text) return message.channel.send('You need to input something for me to tweet!');
+
+		let date = new Date();
 		// see if user is not banned
 		const blacklist = await TwitterBlacklist.findOne({where: {userID:message.author.id}});
 
@@ -52,7 +54,6 @@ class tweetCommand extends Command {
 
 		if (args.text.includes('discord.gg')) return message.channel.send('No discord invite allowed.');
 		
-		if (!Attachment[0] && !args.text) return message.channel.send('You need to input something for me to tweet!');
 		
 		const client = this.client;