This commit is contained in:
Loic Bersier 2018-10-08 17:43:06 +02:00
commit 2051698bd8
5 changed files with 36 additions and 14 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, {
@ -6,13 +7,25 @@ module.exports = class DespacitoCommand extends Command {
group: 'fun', group: 'fun',
memberName: 'despacito', memberName: 'despacito',
description: `despacito`, description: `despacito`,
args: [
{
key: 'user',
prompt: 'What do you want me to say',
type: 'member',
default: ''
}
]
}); });
} }
async run(message) { async run(message, { user }) {
message.say("DES\nPA\nCITO"); if (!user) {
message.channel.send({files: ["https://images-eu.ssl-images-amazon.com/images/I/619fzjO1rmL._SS500.jpg"]}); const number = Object.keys(responseObject).length;
message.channel.send({files: ["https://cdn.dopl3r.com/memes_files/despacito-eS6Lm.jpg"]}); const despacitoNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
message.say("https://www.youtube.com/watch?v=kJQP7kiw5Fk"); 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`)
}
}; };

View file

@ -19,10 +19,9 @@ module.exports = class emoteSayCommand extends Command {
async run(message, { text }) { async run(message, { text }) {
message.delete(); message.delete();
text.toLowerCase().split('')
let emojiArray = []; let emojiArray = [];
for (let i = 0; i < text.length; i++) for (let i = 0; i < text.length; i++)
emojiArray[i] = emojiCharacters[text[i]]; emojiArray[i] = emojiCharacters[text.toLowerCase().split('')[i]];
message.say(emojiArray.join("")) message.say(emojiArray.join(""))

View file

@ -82,7 +82,11 @@ client.registry
// auto respond to messages // auto respond to messages
else if(responseObject[message_content]) { else if(responseObject[message_content]) {
message.channel.send(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); client.on('error', console.error);

10
json/despacito.json Normal file
View file

@ -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"
}

View file

@ -1,9 +1,5 @@
{ {
"like if owned": "👍",
"fortnite": "🤦", "fortnite": "🤦",
"perhaps": "492350777034014720", "perhaps": "492350777034014720",
"press f to pay respect": "493014525788946443", "press f to pay respect": "493014525788946443"
"jeff": "496028845967802378",
"my nama jeff": "496028845967802378",
"my name jeff": "496028845967802378"
} }