diff --git a/commands/fun/despacito.js b/commands/fun/despacito.js index 20c55c8..b41d08b 100644 --- a/commands/fun/despacito.js +++ b/commands/fun/despacito.js @@ -1,4 +1,5 @@ const { Command } = require('discord.js-commando'); +const responseObject = require("../../json/despacito.json"); module.exports = class DespacitoCommand extends Command { constructor(client) { super(client, { @@ -6,13 +7,25 @@ module.exports = class DespacitoCommand extends Command { group: 'fun', memberName: 'despacito', description: `despacito`, + args: [ + { + key: 'user', + prompt: 'What do you want me to say', + type: 'member', + default: '' + } + ] }); } - async run(message) { - message.say("DES\nPA\nCITO"); - message.channel.send({files: ["https://images-eu.ssl-images-amazon.com/images/I/619fzjO1rmL._SS500.jpg"]}); - message.channel.send({files: ["https://cdn.dopl3r.com/memes_files/despacito-eS6Lm.jpg"]}); - message.say("https://www.youtube.com/watch?v=kJQP7kiw5Fk"); - } + async run(message, { user }) { + if (!user) { + const number = Object.keys(responseObject).length; + const despacitoNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1; + message.channel.send({files: [responseObject[despacitoNumber]]}); + } else if (user.id === message.author.id) { + message.say(`Did you just try to despacitoad yourself?`) + } else + message.say(`${user}, you have been despacitoad`) + } }; \ No newline at end of file diff --git a/commands/fun/emotesay.js b/commands/fun/emotesay.js index efaf54d..b93ed93 100644 --- a/commands/fun/emotesay.js +++ b/commands/fun/emotesay.js @@ -19,10 +19,9 @@ module.exports = class emoteSayCommand extends Command { async run(message, { text }) { message.delete(); - text.toLowerCase().split('') let emojiArray = []; for (let i = 0; i < text.length; i++) - emojiArray[i] = emojiCharacters[text[i]]; + emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]]; message.say(emojiArray.join("")) diff --git a/index.js b/index.js index b13f7d0..3faa608 100644 --- a/index.js +++ b/index.js @@ -82,7 +82,11 @@ client.registry // auto respond to messages else if(responseObject[message_content]) { message.channel.send(responseObject[message_content]); - } + } else if (message_content.includes("like if")) { + message.react("\u{1F44D}") + } else if (message_content.includes("jeff")) { + message.react("496028845967802378") + } }}); client.on('error', console.error); diff --git a/json/despacito.json b/json/despacito.json new file mode 100644 index 0000000..fef22f5 --- /dev/null +++ b/json/despacito.json @@ -0,0 +1,10 @@ +{ + "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", + "8": "https://cdn.discordapp.com/attachments/240843640375607296/498096605661102090/38026328_1287563578041482_711316145507926016_n.png" +} \ No newline at end of file diff --git a/json/react.json b/json/react.json index 98aec4a..1030e16 100644 --- a/json/react.json +++ b/json/react.json @@ -1,9 +1,5 @@ { - "like if owned": "👍", "fortnite": "🤦", "perhaps": "492350777034014720", - "press f to pay respect": "493014525788946443", - "jeff": "496028845967802378", - "my nama jeff": "496028845967802378", - "my name jeff": "496028845967802378" + "press f to pay respect": "493014525788946443" } \ No newline at end of file