mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 06:42:51 +02:00
Rewrite Permission Checks and Validators
This commit is contained in:
@@ -11,10 +11,9 @@ module.exports = class SpamCommand extends Command {
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm') {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES')) return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
}
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('ATTACH_FILES'))
|
||||
return message.say(':x: Error! I don\'t have the Attach Files Permission!');
|
||||
return message.channel.send({files: ['./images/Spam.jpg']});
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user