From bcec25b32bbb96cebf88042e8af59b89a0ad3c64 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 23 Mar 2017 17:17:29 +0000 Subject: [PATCH] JSON.parse the response for quote --- commands/random/quotes.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/random/quotes.js b/commands/random/quotes.js index aa70cef3..18a01ee9 100644 --- a/commands/random/quotes.js +++ b/commands/random/quotes.js @@ -30,9 +30,9 @@ module.exports = class QuotesCommand extends commando.Command { cat: randomTypes }) .then(function(response) { - console.log(response); - console.log(response.body); - return message.channel.send(`"${response.body.quote}"\n - *${response.body.author}*`).catch(error => message.channel.send(':x: Error! Something went wrong!')); + let quoteResponse = JSON.parse(response.text); + console.log(quoteResponse); + return message.channel.send(`"${quoteResponse.quote}"\n - *${quoteResponse.author}*`).catch(error => message.channel.send(':x: Error! Something went wrong!')); }).catch(function(err) { console.log(err); return message.channel.send(":x: Error! Unknown Error. Try again later!");