mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 22:32:50 +02:00
Quote, Random in Gelbooru and Rule34, Reorder Groups
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user