mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
JSON.parse the response for quote
This commit is contained in:
@@ -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!");
|
||||
|
||||
Reference in New Issue
Block a user