Despacito

This commit is contained in:
loicbersier 2018-10-06 13:24:14 +02:00
parent 72b8425ea4
commit fd579ae39e
2 changed files with 13 additions and 4 deletions

View file

@ -1,4 +1,5 @@
const { Command } = require('discord.js-commando'); const { Command } = require('discord.js-commando');
const responseObject = require("../../json/despacito.json");
module.exports = class DespacitoCommand extends Command { module.exports = class DespacitoCommand extends Command {
constructor(client) { constructor(client) {
super(client, { super(client, {
@ -10,9 +11,8 @@ module.exports = class DespacitoCommand extends Command {
} }
async run(message) { async run(message) {
message.say("DES\nPA\nCITO"); const number = Object.keys(responseObject).length;
message.channel.send({files: ["https://images-eu.ssl-images-amazon.com/images/I/619fzjO1rmL._SS500.jpg"]}); const despacitoNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
message.channel.send({files: ["https://cdn.dopl3r.com/memes_files/despacito-eS6Lm.jpg"]}); message.channel.send({files: [responseObject[despacitoNumber]]});
message.say("https://www.youtube.com/watch?v=kJQP7kiw5Fk");
} }
}; };

9
json/despacito.json Normal file
View file

@ -0,0 +1,9 @@
{
"1": "https://cdn.discordapp.com/attachments/475999813587173406/498088708210425866/image-50.jpg",
"2": "https://cdn.discordapp.com/attachments/475999813587173406/498088708872994818/image-29.png",
"3": "https://cdn.discordapp.com/attachments/475999813587173406/498088708872994821/magik-2.png",
"4": "https://cdn.discordapp.com/attachments/475999813587173406/498088709443289088/image-26.png",
"5": "https://cdn.discordapp.com/attachments/475999813587173406/498088709443289089/image-301.jpg",
"6": "https://cdn.discordapp.com/attachments/475999813587173406/498088709883953162/458da9a.jpg",
"7": "https://cdn.discordapp.com/attachments/349122704995254275/498086713026150400/despacito-eS6Lm.jpg"
}