2018-09-08 01:50:13 +02:00
|
|
|
const { Command } = require('discord.js-commando');
|
2018-10-06 13:24:14 +02:00
|
|
|
const responseObject = require("../../json/despacito.json");
|
2018-09-08 01:50:13 +02:00
|
|
|
module.exports = class DespacitoCommand extends Command {
|
|
|
|
constructor(client) {
|
|
|
|
super(client, {
|
|
|
|
name: 'despacito',
|
|
|
|
group: 'fun',
|
|
|
|
memberName: 'despacito',
|
2018-09-18 15:44:35 +02:00
|
|
|
description: `despacito`,
|
2018-10-07 10:05:26 +02:00
|
|
|
args: [
|
|
|
|
{
|
|
|
|
key: 'user',
|
|
|
|
prompt: 'What do you want me to say',
|
|
|
|
type: 'member',
|
|
|
|
default: ''
|
|
|
|
}
|
|
|
|
]
|
2018-09-08 01:50:13 +02:00
|
|
|
});
|
|
|
|
}
|
|
|
|
|
2018-10-07 10:05:26 +02:00
|
|
|
async run(message, { user }) {
|
|
|
|
if (!user) {
|
2018-10-06 13:24:14 +02:00
|
|
|
const number = Object.keys(responseObject).length;
|
|
|
|
const despacitoNumber = Math.floor (Math.random() * (number - 1 + 1)) + 1;
|
2018-10-08 23:27:41 +02:00
|
|
|
if (!user)
|
|
|
|
return message.channel.send({files: [responseObject[despacitoNumber]]});
|
2018-10-07 23:02:05 +02:00
|
|
|
} else if (user.id === message.author.id) {
|
2018-10-08 23:27:41 +02:00
|
|
|
return message.say(`Did you just try to despacitoad yourself?`);
|
2018-10-08 17:57:08 +02:00
|
|
|
} else if (user.id === this.client.user.id) {
|
2018-10-08 23:27:41 +02:00
|
|
|
return message.say('Nice try but you wont get me :^)');
|
2018-10-07 23:02:05 +02:00
|
|
|
} else
|
2018-10-08 18:10:35 +02:00
|
|
|
message.delete();
|
|
|
|
message.say(`${user}, you have been despacitoad`);
|
2018-10-07 10:05:26 +02:00
|
|
|
}
|
2018-09-08 01:50:13 +02:00
|
|
|
};
|