mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
29 lines
597 B
JavaScript
29 lines
597 B
JavaScript
const Command = require('../../framework/Command');
|
|
const { stripIndents } = require('common-tags');
|
|
const answers = ['😄 Yes', '🙁 No'];
|
|
|
|
module.exports = class YesNoCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'yes-no',
|
|
aliases: ['y-n'],
|
|
group: 'random-res',
|
|
description: 'Answers a yes/no question randomly.',
|
|
args: [
|
|
{
|
|
key: 'question',
|
|
type: 'string',
|
|
max: 1950
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { question }) {
|
|
return msg.say(stripIndents`
|
|
_${question}_
|
|
${answers[Math.floor(Math.random() * answers.length)]}
|
|
`);
|
|
}
|
|
};
|