From 422a7b69db8dddc58039d8529467303bad3c6f13 Mon Sep 17 00:00:00 2001 From: loicbersier Date: Sat, 30 Nov 2019 19:06:11 +0100 Subject: [PATCH] let people use this command without manage message perm --- commands/general/say.js | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/commands/general/say.js b/commands/general/say.js index e4ce7141..ca8e431d 100644 --- a/commands/general/say.js +++ b/commands/general/say.js @@ -7,7 +7,7 @@ class SayCommand extends Command { super('say', { aliases: ['say', 'sayd'], category: 'general', - clientPermissions: ['SEND_MESSAGES', 'MANAGE_MESSAGES'], + clientPermissions: ['SEND_MESSAGES'], args: [ { id: 'text', @@ -148,11 +148,18 @@ class SayCommand extends Command { // Send the final text if (attach) { if (message.util.parsed.alias == 'sayd') - message.delete(); + if (message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) + message.delete(); + else + message.channel.send('Im missing he `MANAGE_MESSAGES` perm to delete your message!'); + return message.channel.send(text, {files: [attach]}); } else { if (message.util.parsed.alias == 'sayd') - message.delete(); + if (message.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES')) + message.delete(); + else + message.channel.send('Im missing he `MANAGE_MESSAGES` perm to delete your message!'); return message.channel.send(text); } }