mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-05 08:12:04 +02:00
25 lines
761 B
JavaScript
25 lines
761 B
JavaScript
const { Command } = require('discord.js-commando');
|
|
const fortunes = require('./fortunes.json');
|
|
|
|
module.exports = class FortuneCookieCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'fortune',
|
|
aliases: [
|
|
'fortunecookie'
|
|
],
|
|
group: 'response',
|
|
memberName: 'fortune',
|
|
description: 'Fortune Cookie.'
|
|
});
|
|
}
|
|
|
|
run(message) {
|
|
if (message.channel.type !== 'dm') {
|
|
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
|
}
|
|
const fortune = fortunes[Math.floor(Math.random() * fortunes.length)];
|
|
return message.say(fortune);
|
|
}
|
|
};
|