2018-09-07 22:48:15 +02:00
|
|
|
const { Command } = require('discord.js-commando');
|
2018-09-20 17:50:28 +02:00
|
|
|
const responseObject = require("../../json/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) {
|
2018-09-09 16:56:39 +02:00
|
|
|
const number = Object.keys(responseObject).length;
|
2018-09-08 20:50:34 +02:00
|
|
|
const picNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
|
2018-09-21 16:20:30 +02:00
|
|
|
message.channel.send(picNumber, {files: [responseObject[picNumber]]});
|
2018-09-08 20:50:34 +02:00
|
|
|
}
|
2018-09-07 22:48:15 +02:00
|
|
|
};
|