Haha-Yes/event/listeners/commandblocked.js

40 lines
1.5 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;
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'];
ownerMessage = ownerMessage[Math.floor( Math.random() * ownerMessage.length )];
message.reply(ownerMessage);
break;
2019-01-14 11:33:01 +01:00
case 'guild':
message.reply('You can\'t use this command in a guild!');
2019-01-02 08:09:45 +01:00
break;
2019-01-14 11:33:01 +01:00
case 'dm':
message.reply('You can\'t use this command in DM!');
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'];
blacklistMessage = blacklistMessage[Math.floor( Math.random() * blacklistMessage.length )];
2019-04-13 17:49:58 +02:00
message.reply(blacklistMessage);
break;
2019-01-19 19:11:27 +01:00
case 'serverblacklist':
message.channel.send('This server have been blacklisted... to appeal contact Supositware#1616, and now i will yeet out of here');
2019-01-21 22:13:11 +01:00
message.guild.leave();
2019-01-19 19:11:27 +01:00
break;
2019-01-02 08:09:45 +01:00
}
}
2018-12-30 01:20:24 +01:00
}
module.exports = CommandBlockedListener;