You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Haha-Yes/commands/fun/funfact.js

18 lines
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]}`);
}
};