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
@@ -18,6 +18,9 @@ module.exports = class LockdownCommand extends Command {
return true;
}
return 'Please enter either start or stop.';
},
parse: text => {
return text.toLowerCase();
}
}]
});
@@ -32,7 +35,7 @@ module.exports = class LockdownCommand extends Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['READ_MESSAGES', 'SEND_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission('ADMINISTRATOR')) return message.say(':x: Error! I don\'t have the Administrator permission! This is not given by default, as that\'s quite bad practice. Please give it to me to use the lockdown command!');
}
const type = args.type.toLowerCase();
const { type } = args;
if (type === 'start') {
try {
await message.channel.overwritePermissions(message.guild.defaultRole, {