Haha-Yes/commands/fun/badmeme.js

18 lines
690 B
JavaScript
Raw Normal View History

2018-09-07 22:48:15 +02:00
const { Command } = require('discord.js-commando');
2018-09-08 20:51:41 +02:00
const responseObject = require("../../randPic.json");
2018-09-07 22:48:15 +02:00
module.exports = class BadmemeCommand extends Command {
constructor(client) {
super(client, {
name: 'badmeme',
group: 'fun',
memberName: 'badmeme',
2018-09-09 17:07:42 +02:00
description: `Some very bad meme. There is currently **${Object.keys(responseObject).length}** meme`,
2018-09-07 22:48:15 +02:00
});
}
2018-09-09 21:32:08 +02:00
async run(message) {
const number = Object.keys(responseObject).length;
const picNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
2018-09-09 16:02:35 +02:00
message.channel.send(`${picNumber}: ${responseObject[picNumber]}`);
}
2018-09-07 22:48:15 +02:00
};