let people use this command without manage message perm

This commit is contained in:
loicbersier 2019-11-30 19:06:11 +01:00
parent 4e86a6f3c5
commit 422a7b69db

View file

@ -7,7 +7,7 @@ class SayCommand extends Command {
super('say', { super('say', {
aliases: ['say', 'sayd'], aliases: ['say', 'sayd'],
category: 'general', category: 'general',
clientPermissions: ['SEND_MESSAGES', 'MANAGE_MESSAGES'], clientPermissions: ['SEND_MESSAGES'],
args: [ args: [
{ {
id: 'text', id: 'text',
@ -148,11 +148,18 @@ class SayCommand extends Command {
// Send the final text // Send the final text
if (attach) { if (attach) {
if (message.util.parsed.alias == 'sayd') 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]}); return message.channel.send(text, {files: [attach]});
} else { } else {
if (message.util.parsed.alias == 'sayd') 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); return message.channel.send(text);
} }
} }