Haha-Yes/commands/fun/dank.js

25 lines
1,023 B
JavaScript
Raw Permalink Normal View History

const { Command } = require('discord.js-commando');
2018-09-20 17:50:28 +02:00
const responseObject = require("../../json/randVid.json");
2018-11-28 01:35:26 +01:00
const SelfReloadJSON = require('self-reload-json');
2018-12-25 19:17:07 +01:00
const blacklist = require('../../json/blacklist.json');
2018-12-05 00:52:21 +01:00
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-12-06 23:01:40 +01:00
let blacklistJson = new SelfReloadJSON('./json/blacklist.json');
2018-11-28 01:35:26 +01:00
if(blacklistJson[message.author.id])
return blacklist(blacklistJson[message.author.id] , message)
const number = Object.keys(responseObject).length;
const vidNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
message.channel.send(`${vidNumber}: ${responseObject[vidNumber]}`);
}
};