2018-09-08 01:50:13 +02:00
|
|
|
const { Command } = require('discord.js-commando');
|
2018-09-08 20:34:03 +02:00
|
|
|
const responseObject = require("../../randVid.json");
|
2018-09-08 01:50:13 +02:00
|
|
|
module.exports = class DespacitoCommand extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'despacito',
|
|
|
|
group: 'fun',
|
|
|
|
memberName: 'despacito',
|
2018-09-09 17:07:42 +02:00
|
|
|
description: `despacito, what where you excepting? There is currently **${Object.keys(responseObject).length}** vid`,
|
2018-09-08 01:50:13 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-09-09 21:32:08 +02:00
|
|
|
async run(message) {
|
2018-09-09 16:56:39 +02:00
|
|
|
const number = Object.keys(responseObject).length;
|
2018-09-08 20:34:03 +02:00
|
|
|
const vidNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
|
2018-09-09 16:02:35 +02:00
|
|
|
message.channel.send(`${vidNumber}: ${responseObject[vidNumber]}`);
|
2018-09-08 20:34:03 +02:00
|
|
|
}
|
2018-09-08 01:50:13 +02:00
|
|
|
};
|