Quote, Random in Gelbooru and Rule34, Reorder Groups

This commit is contained in:
Daniel Odendahl Jr
2017-07-25 21:31:14 +00:00
parent 0d51d7ca78
commit 4ee179f359
12 changed files with 54 additions and 20 deletions
+32
View File
@@ -0,0 +1,32 @@
const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const snekfetch = require('snekfetch');
module.exports = class QuoteCommand extends Command {
constructor(client) {
super(client, {
name: 'quote',
group: 'random-res',
memberName: 'quote',
description: 'Responds with a random quote.',
clientPermissions: ['EMBED_LINKS']
});
}
async run(msg) {
const { body } = await snekfetch
.get('https://api.forismatic.com/api/1.0/')
.query({
method: 'getQuote',
lang: 'en',
format: 'json'
});
const embed = new MessageEmbed()
.setColor(0x9797FF)
.setURL(body.quoteLink)
.setAuthor(body.quoteAuthor)
.setDescription(body.quoteText);
return msg.embed(embed);
}
};