Destructuring Args

This commit is contained in:
Daniel Odendahl Jr
2017-04-19 12:21:38 +00:00
parent 4fc536531d
commit e105b6aa5d
72 changed files with 228 additions and 167 deletions
+4 -1
View File
@@ -30,6 +30,9 @@ module.exports = class PruneCommand extends Command {
return true;
}
return 'Too many or two few messages to delete. Limit 1-99.';
},
parse: count => {
return count + 1;
}
}]
});
@@ -45,7 +48,7 @@ module.exports = class PruneCommand extends Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission('READ_MESSAGE_HISTORY')) return message.say(':x: Error! I don\'t have the Read Message History Permission!');
if (!message.channel.permissionsFor(this.client.user).hasPermission('MANAGE_MESSAGES')) return message.say(':x: Error! I don\'t have the Manage Messages Permission!');
}
const count = args.count + 1;
const { count } = args;
try {
const messages = await message.channel.fetchMessages({
limit: count