Remove all useless async

This commit is contained in:
Daniel Odendahl Jr
2017-03-24 12:16:58 +00:00
parent 33b7d18d54
commit 0ce7eb3ee1
95 changed files with 287 additions and 287 deletions
+5 -5
View File
@@ -18,7 +18,7 @@ module.exports = class UrbanDictionary extends commando.Command {
});
}
async run(message) {
run(message) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
@@ -26,10 +26,10 @@ module.exports = class UrbanDictionary extends commando.Command {
let wordToDefine = message.content.split(" ").slice(1).join(" ");
urban(wordToDefine).first(function(response) {
if (!response) {
message.channel.send(":x: Error! Word not found!");
return message.channel.send(":x: Error! Word not found!");
}
else if (!response.definition) {
message.channel.send(":x: Error! Word has no definition!");
return message.channel.send(":x: Error! Word has no definition!");
}
else if (response.example) {
const embed = new Discord.RichEmbed()
@@ -40,7 +40,7 @@ module.exports = class UrbanDictionary extends commando.Command {
.setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`)
.addField('**Example:**',
response.example.substr(0, 1900));
message.channel.sendEmbed(embed);
return message.channel.sendEmbed(embed);
}
else {
const embed = new Discord.RichEmbed()
@@ -49,7 +49,7 @@ module.exports = class UrbanDictionary extends commando.Command {
.setURL(response.permalink)
.setTitle(response.word)
.setDescription(`${response.definition.substr(0, 1900)} [Read the Rest Here!](${response.permalink})`);
message.channel.sendEmbed(embed);
return message.channel.sendEmbed(embed);
}
});
}