Haha-Yes/commands/fun/badmeme

18 lines
698 B
Text
Raw Normal View History

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) {
const number = Object.keys(responseObject).length;
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-07 22:48:15 +02:00
};