From 4bf63d014ad6b7a5e54b7d0052dbbc67deb2360d Mon Sep 17 00:00:00 2001 From: loicbersier Date: Mon, 2 Mar 2020 19:53:25 +0100 Subject: [PATCH] beautiful embed --- event/listeners/commandblocked.js | 19 ++++++++++++++----- event/listeners/missingPermissions.js | 15 +++++++++++---- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/event/listeners/commandblocked.js b/event/listeners/commandblocked.js index 49852a0..0594e5b 100644 --- a/event/listeners/commandblocked.js +++ b/event/listeners/commandblocked.js @@ -12,11 +12,17 @@ class CommandBlockedListener extends Listener { console.log(`${message.author.username} was blocked from using ${command.id} because of ${reason}!`); let ownerMessage; let blacklistMessage; + let Embed = this.client.util.embed() + .setColor('RED') + .setTitle('Error') + .setDescription('Something blocked you'); + switch(reason) { case 'owner': ownerMessage = ['Nice try but you aren\'t the owner ', 'LOADING SUPER SECRET COMMAND Wait a minute... you aren\'t the owner!', 'uhm, how about no']; - ownerMessage = ownerMessage[Math.floor( Math.random() * ownerMessage.length )]; - message.reply(ownerMessage); + Embed.setTitle('You are not the owner.'); + Embed.setDescription(ownerMessage[Math.floor( Math.random() * ownerMessage.length )]); + message.reply(Embed); break; case 'guild': message.reply('You can\'t use this command in a guild!'); @@ -26,11 +32,14 @@ class CommandBlockedListener extends Listener { 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 )]; - message.reply(blacklistMessage); + Embed.setTitle('You are blacklisted.'); + Embed.setDescription(blacklistMessage[Math.floor( Math.random() * blacklistMessage.length )]); + message.reply(Embed); break; case 'serverblacklist': - message.channel.send(`This server have been blacklisted... to appeal contact ${this.client.users.get(this.client.ownerID).username}#${this.client.users.get(this.client.ownerID).discriminator}, and now i will yeet out of here`); + Embed.setTitle('Server blacklisted.'); + Embed.setDescription(`This server have been blacklisted... to appeal contact ${this.client.users.get(this.client.ownerID).username}#${this.client.users.get(this.client.ownerID).discriminator}, and now i will yeet out of here`); + message.channel.send(Embed); message.guild.leave(); break; } diff --git a/event/listeners/missingPermissions.js b/event/listeners/missingPermissions.js index 947f3c4..92609f9 100644 --- a/event/listeners/missingPermissions.js +++ b/event/listeners/missingPermissions.js @@ -9,21 +9,28 @@ class missingPermissionsListener extends Listener { } async exec(message, command, type, missing) { + let Embed = this.client.util.embed() + .setColor('RED') + .setTitle('Missing permission') + .setDescription(`Im missing the required permissions for the ${command.id} command!`) + .addField('Missing permission:', missing); + switch(type) { case 'client': if (missing == 'SEND_MESSAGES') { return; } else { - message.reply(`Im missing the required permissions for this command!, \`${missing}\``); + message.reply(Embed); } break; case 'user': if (missing == 'SEND_MESSAGES') { - return message.author.send(`You are missing some permissions to use this command!, \`${missing}\``); + Embed.setDescription(`You are missing the required permissions for the ${command.id} command!`); + return message.author.send(Embed); } else { - message.reply(`You are missing some permissions to use this command!, \`${missing}\``); + Embed.setDescription(`You are missing the required permissions for the ${command.id} command!`); + message.reply(Embed); } - break; } }