mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-25 14:21:41 +02:00
Rewrite Permission Checks and Validators
This commit is contained in:
@@ -7,13 +7,11 @@ module.exports = class SayCommand extends Command {
|
||||
aliases: [
|
||||
'copy',
|
||||
'repeat',
|
||||
'parrot',
|
||||
'echo'
|
||||
],
|
||||
group: 'textedit',
|
||||
memberName: 'say',
|
||||
description: 'Make XiaoBot say what you wish.',
|
||||
guildOnly: true,
|
||||
args: [{
|
||||
key: 'text',
|
||||
prompt: 'What text would you like XiaoBot to say?',
|
||||
@@ -23,12 +21,7 @@ module.exports = class SayCommand extends Command {
|
||||
}
|
||||
|
||||
run(message, args) {
|
||||
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('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
|
||||
}
|
||||
const { text } = args;
|
||||
message.delete();
|
||||
return message.say(`\u180E${text}`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user