mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 14:21:41 +02:00
return and await
This commit is contained in:
@@ -26,7 +26,7 @@ module.exports = class DefineCommand extends commando.Command {
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let defineThis = encodeURI(message.content.split(" ").slice(1).join(" "));
|
||||
request
|
||||
await request
|
||||
.get(`http://api.wordnik.com:80/v4/word.json/${defineThis}/definitions`)
|
||||
.query({
|
||||
limit: 1,
|
||||
@@ -40,9 +40,10 @@ module.exports = class DefineCommand extends commando.Command {
|
||||
.setColor(0x9797FF)
|
||||
.setTitle(response.body[0].word)
|
||||
.setDescription(response.body[0].text);
|
||||
message.channel.sendEmbed(embed).catch(console.error);
|
||||
return message.channel.sendEmbed(embed).catch(console.error);
|
||||
}).catch(function(err) {
|
||||
message.channel.send(":x: Error! Word not Found!");
|
||||
console.log(err);
|
||||
return message.channel.send(":x: Error! Word not Found!");
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user