mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-13 15:58:06 +02:00
Updates
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
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',
|
||||
memberName: 'fortune',
|
||||
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(', ')}
|
||||
`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user