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
+2 -4
View File
@@ -13,7 +13,7 @@ module.exports = class WarnCommand extends Command {
args: [{
key: 'member',
prompt: 'What member do you want to warn?',
type: 'user'
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
@@ -37,9 +37,7 @@ module.exports = class WarnCommand extends Command {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
}
let member = message.guild.member(args.member);
if (!member) member = await message.guild.fetchMember(args.member);
const reason = args.reason;
const { member, reason } = args;
if (!message.guild.channels.exists('name', 'mod_logs')) return message.say(':x: Error! Could not find the mod_logs channel! Please create it!');
try {
await message.say(':ok_hand:');