Haha-Yes/commands/fun/dank.js

22 lines
874 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");
2018-10-15 20:23:45 +02:00
const blacklist = require('../../json/blacklist.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) {
2018-10-15 20:23:45 +02:00
if(blacklist[message.author.id])
return message.channel.send("You are blacklisted")
const number = Object.keys(responseObject).length;
const vidNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
message.channel.send(`${vidNumber}: ${responseObject[vidNumber]}`);
}
};