return and await

This commit is contained in:
Daniel Odendahl Jr
2017-03-23 13:16:59 +00:00
parent cea110ce4b
commit 7c0a39ec5c
83 changed files with 295 additions and 264 deletions
+8 -4
View File
@@ -24,12 +24,16 @@ module.exports = class SayCommand extends commando.Command {
console.log(`[Command] ${message.content}`);
let copycat = message.content.split(" ").slice(1).join(" ");
if (!copycat) {
message.channel.send(":x: Error! Nothing to say!");
return message.channel.send(":x: Error! Nothing to say!");
}
else {
message.channel.send(copycat);
if (message.channel.type === 'dm') return;
message.delete();
if (message.channel.type === 'dm') {
return message.channel.send(copycat);
}
else {
await message.delete();
return message.channel.send(copycat);
}
}
}
};