mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-22 18:29:14 +02:00
Quote, Random in Gelbooru and Rule34, Reorder Groups
This commit is contained in:
@@ -1,18 +0,0 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const fishes = [':fish:', ':tropical_fish:', ':blowfish:', ':wrench:'];
|
||||
|
||||
module.exports = class FishyCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'fishy',
|
||||
group: 'random-res',
|
||||
memberName: 'fishy',
|
||||
description: 'Catches a fish.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const fish = fishes[Math.floor(Math.random() * fishes.length)];
|
||||
return msg.say(`You caught a: ${fish}`);
|
||||
}
|
||||
};
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -0,0 +1,58 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class TodayCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'today',
|
||||
aliases: ['event', 'history'],
|
||||
group: 'random-res',
|
||||
memberName: 'today',
|
||||
description: 'Responds with an event that occurred today in history, or on a specific day.',
|
||||
clientPermissions: ['EMBED_LINKS'],
|
||||
args: [
|
||||
{
|
||||
key: 'month',
|
||||
prompt: 'Which month do you want events for?',
|
||||
type: 'integer',
|
||||
default: '',
|
||||
validate: (month) => {
|
||||
if (month < 13 && month > 0) return true;
|
||||
else return 'Please enter a valid month.';
|
||||
}
|
||||
},
|
||||
{
|
||||
key: 'day',
|
||||
prompt: 'Which day do you want events for?',
|
||||
type: 'integer',
|
||||
default: '',
|
||||
validate: (day) => {
|
||||
if (day < 32 && day > 0) return true;
|
||||
else return 'Please enter a valid day.';
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
const { month, day } = args;
|
||||
try {
|
||||
const { text } = await snekfetch
|
||||
.get(`http://history.muffinlabs.com/date${month && day ? `/${month}/${day}` : ''}`);
|
||||
const body = JSON.parse(text);
|
||||
const events = body.data.Events;
|
||||
const event = events[Math.floor(Math.random() * events.length)];
|
||||
const embed = new MessageEmbed()
|
||||
.setColor(0x9797FF)
|
||||
.setURL(body.url)
|
||||
.setTitle(`On this day (${body.date})...`)
|
||||
.setTimestamp()
|
||||
.setDescription(`${event.year}: ${event.text}`);
|
||||
return msg.embed(embed);
|
||||
} catch (err) {
|
||||
return msg.say(`An error occurred: \`${err.message}\`. You likely entered an invalid date.`);
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,18 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const songs = require('../../assets/json/vocaloid');
|
||||
|
||||
module.exports = class VocaloidCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'vocaloid',
|
||||
group: 'random-res',
|
||||
memberName: 'vocaloid',
|
||||
description: 'Responds with a random VOCALOID song.'
|
||||
});
|
||||
}
|
||||
|
||||
run(msg) {
|
||||
const song = songs[Math.floor(Math.random() * songs.length)];
|
||||
return msg.say(song);
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,27 @@
|
||||
const Command = require('../../structures/Command');
|
||||
const { MessageEmbed } = require('discord.js');
|
||||
const snekfetch = require('snekfetch');
|
||||
|
||||
module.exports = class WouldYouRatherCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'would-you-rather',
|
||||
aliases: ['wy-rather'],
|
||||
group: 'random-res',
|
||||
memberName: 'would-you-rather',
|
||||
description: 'Responds with a random would you rather question.',
|
||||
clientPermissions: ['EMBED_LINKS']
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
const { body } = await snekfetch
|
||||
.get('http://www.rrrather.com/botapi');
|
||||
const embed = new MessageEmbed()
|
||||
.setTitle(`${body.title}...`)
|
||||
.setURL(body.link)
|
||||
.setColor(0x9797FF)
|
||||
.setDescription(`${body.choicea} OR ${body.choiceb}?`);
|
||||
return msg.embed(embed);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user