Haha-Yes/event/listeners/commandblocked.js

54 lines
2 KiB
JavaScript
Raw Normal View History

2018-12-30 01:20:24 +01:00
const { Listener } = require('discord-akairo');
class CommandBlockedListener extends Listener {
2019-01-02 08:09:45 +01:00
constructor() {
super('commandBlocked', {
emitter: 'commandHandler',
2019-01-02 21:46:12 +01:00
event: 'commandBlocked'
2019-01-02 08:09:45 +01:00
});
}
2018-12-30 01:20:24 +01:00
2019-01-14 11:33:01 +01:00
async exec(message, command, reason) {
2019-01-02 08:09:45 +01:00
console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`);
let ownerMessage;
let blacklistMessage;
2020-03-02 19:53:25 +01:00
let Embed = this.client.util.embed()
.setColor('RED')
.setTitle('Error')
.setDescription('Something blocked you');
2019-01-02 08:09:45 +01:00
switch(reason) {
2019-01-14 11:33:01 +01:00
case 'owner':
2019-01-02 08:09:45 +01:00
ownerMessage = ['Nice try but you aren\'t the owner <a:memed:433320880135733248>', 'LOADING SUPER SECRET COMMAND <a:loadingmin:527579785212329984> Wait a minute... you aren\'t the owner!', 'uhm, how about no'];
2020-03-02 19:53:25 +01:00
Embed.setTitle('You are not the owner.');
Embed.setDescription(ownerMessage[Math.floor( Math.random() * ownerMessage.length )]);
message.reply(Embed);
2019-01-02 08:09:45 +01:00
break;
2019-01-14 11:33:01 +01:00
case 'guild':
2020-03-19 23:24:31 +01:00
message.reply('You can\'t use this command in DM!');
2019-01-02 08:09:45 +01:00
break;
2019-01-14 11:33:01 +01:00
case 'dm':
2020-03-19 23:24:31 +01:00
message.reply('You can\'t use this command in a guild!');
2019-01-02 08:09:45 +01:00
break;
case 'blacklist':
blacklistMessage = ['bro... i think you are blacklisted.... OWNED!!!', 'You can\'t use this command because you have been blacklisted!',' you are blacklisted!!!1111!! be less naughty next time!', 'blacklisted,,,,,, lol owned bro'];
2020-03-02 19:53:25 +01:00
Embed.setTitle('You are blacklisted.');
Embed.setDescription(blacklistMessage[Math.floor( Math.random() * blacklistMessage.length )]);
message.reply(Embed);
2019-04-13 17:49:58 +02:00
break;
2019-01-19 19:11:27 +01:00
case 'serverblacklist':
2020-03-02 19:53:25 +01:00
Embed.setTitle('Server blacklisted.');
Embed.setDescription(`This server have been blacklisted... to appeal contact ${this.client.users.resolveID(this.client.ownerID).tag}, and now i will yeet out of here`);
2020-03-02 19:53:25 +01:00
message.channel.send(Embed);
2019-01-21 22:13:11 +01:00
message.guild.leave();
2019-01-19 19:11:27 +01:00
break;
2020-03-18 02:28:29 +01:00
case 'commandblock':
Embed.setTitle('Command blocked.');
Embed.setDescription('The admins of this server blocked this command.');
message.channel.send(Embed);
break;
2019-01-02 08:09:45 +01:00
}
}
2018-12-30 01:20:24 +01:00
}
module.exports = CommandBlockedListener;