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 -2
View File
@@ -23,8 +23,8 @@ module.exports = class ShipCommand extends Command {
if (message.channel.type !== 'dm') {
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
}
const shipped = args.things;
const { things } = args;
const percentage = Math.floor(Math.random() * 100) + 1;
return message.say(`I'd give ${shipped} a ${percentage}%!`);
return message.say(`I'd give ${things} a ${percentage}%!`);
}
};