Haha-Yes/commands/fun/dank.js

18 lines
718 B
JavaScript
Raw Normal View History

const { Command } = require('discord.js-commando');
2018-09-20 17:50:28 +02:00
const responseObject = require("../../json/randVid.json");
module.exports = class dankCommand extends Command {
constructor(client) {
super(client, {
name: 'dank',
group: 'fun',
memberName: 'dank',
description: `send some random dank vid (yea sorry for that name). There is currently **${Object.keys(responseObject).length}** vid`,
});
}
async run(message) {
const number = Object.keys(responseObject).length;
const vidNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
message.channel.send(`${vidNumber}: ${responseObject[vidNumber]}`);
}
};