Files
xiao/commands/random/easteregg.js
T
Daniel Odendahl Jr bc7153ec91 Remove Help Examples
2017-04-23 17:03:17 +00:00

40 lines
1.2 KiB
JavaScript

const { Command } = require('discord.js-commando');
const eastereggs = require('./eastereggs.json');
module.exports = class EasterEggCommand extends Command {
constructor(client) {
super(client, {
name: 'easteregg',
aliases: [
'tag',
'easter-egg'
],
group: 'random',
memberName: 'easteregg',
description: 'Can you discover all the easter eggs?',
args: [{
key: 'tag',
prompt: 'What easter egg do you want to view?',
type: 'string',
validate: tag => {
if (eastereggs[tag.toLowerCase()]) {
return true;
}
return 'Nope, that\'s not a valid easter egg. Try again!';
},
parse: text => {
return text.toLowerCase();
}
}]
});
}
run(message, args) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const { tag } = args;
return message.say(eastereggs[tag]);
}
};