mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Better Validators and More Destucturing
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user