mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-04 15:56:52 +02:00
30 lines
798 B
JavaScript
30 lines
798 B
JavaScript
const Command = require('../../structures/Command');
|
|
const snekfetch = require('snekfetch');
|
|
const { stripIndents } = require('common-tags');
|
|
|
|
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) {
|
|
try {
|
|
const { body } = await snekfetch
|
|
.get('http://www.rrrather.com/botapi');
|
|
return msg.say(stripIndents`
|
|
${body.title}...
|
|
${body.choicea} OR ${body.choiceb}?
|
|
`);
|
|
} catch (err) {
|
|
return msg.say(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
|
}
|
|
}
|
|
};
|