Haha-Yes/commands/fun/despacito.js

18 lines
712 B
JavaScript
Raw Normal View History

2018-09-08 01:50:13 +02:00
const { Command } = require('discord.js-commando');
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) {
const number = Object.keys(responseObject).length;
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 01:50:13 +02:00
};