mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
22 lines
587 B
JavaScript
22 lines
587 B
JavaScript
const Command = require('../../framework/Command');
|
|
const { stripIndents } = require('common-tags');
|
|
const fortunes = require('../../assets/json/fortune');
|
|
|
|
module.exports = class FortuneCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'fortune',
|
|
aliases: ['fortune-cookie'],
|
|
group: 'random-res',
|
|
description: 'Responds with a random fortune.'
|
|
});
|
|
}
|
|
|
|
run(msg) {
|
|
return msg.say(stripIndents`
|
|
${fortunes[Math.floor(Math.random() * fortunes.length)]}
|
|
${Array.from({ length: 6 }, () => Math.floor(Math.random() * 100)).join(', ')}
|
|
`);
|
|
}
|
|
};
|