Better Validators and More Destucturing

This commit is contained in:
Daniel Odendahl Jr
2017-04-19 18:55:26 +00:00
parent c064401b37
commit d77f71b66a
40 changed files with 114 additions and 124 deletions
+2 -2
View File
@@ -34,9 +34,9 @@ module.exports = class DefineCommand extends Command {
}
const { word } = args;
try {
const response = await request
const { body } = await request
.get(`http://api.wordnik.com:80/v4/word.json/${word}/definitions?limit=1&includeRelated=false&useCanonical=false&api_key=${process.env.WORDNIK_KEY}`);
const data = response.body[0];
const data = body[0];
const embed = new RichEmbed()
.setColor(0x9797FF)
.setTitle(data.word)