Check for message first

This commit is contained in:
loicbersier 2020-03-18 18:26:36 +01:00
parent 35b754cf16
commit 3873ba86de

View file

@ -31,8 +31,10 @@ class tweetCommand extends Command {
} }
async exec(message, args) { async exec(message, args) {
let date = new Date();
let Attachment = (message.attachments).array(); 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 // see if user is not banned
const blacklist = await TwitterBlacklist.findOne({where: {userID:message.author.id}}); 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 (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; const client = this.client;