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

22 lines
685 B
JavaScript

const { Command } = require('discord.js-commando');
const facts = require('./facts.json');
module.exports = class FactCoreCommand extends Command {
constructor(client) {
super(client, {
name: 'factcore',
group: 'response',
memberName: 'factcore',
description: 'Says a random Fact Core quote.'
});
}
run(message) {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const fact = facts[Math.floor(Math.random() * facts.length)];
return message.say(fact);
}
};