Haha-Yes/commands/fun/funfact.js
2018-09-09 01:17:11 +02:00

18 lines
No EOL
593 B
JavaScript

const { Command } = require('discord.js-commando');
const responseObject = require("../../funFact.json");
module.exports = class FunFactCommand extends Command {
constructor(client) {
super(client, {
name: 'funfact',
group: 'fun',
memberName: 'funfact',
description: 'Replies with a some fun fact.',
});
}
run(message) {
const number = 2;
const funFactNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
message.channel.send(`Fun fact: ${responseObject[funFactNumber]}`);
}
};