Haha-Yes/commands/fun/funfact.js

18 lines
593 B
JavaScript
Raw Normal View History

2018-09-09 01:17:11 +02:00
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]}`);
}
};