list in Util

This commit is contained in:
Daniel Odendahl Jr
2017-08-17 21:55:11 +00:00
parent c532eb726c
commit 80d86b3411
3 changed files with 14 additions and 6 deletions
+2 -2
View File
@@ -1,4 +1,5 @@
const Command = require('../../structures/Command');
const { list } = require('../../structures/Util');
module.exports = class ShipCommand extends Command {
constructor(client) {
@@ -20,7 +21,6 @@ module.exports = class ShipCommand extends Command {
run(msg, args) {
const { things } = args;
const list = `${things.slice(0, -1).join(', ')}${things.length > 1 ? ' and ' : ''}${things.slice(-1)}`;
return msg.say(`I'd give ${list} a ${Math.floor(Math.random() * 100) + 1}%!`);
return msg.say(`I'd give ${list(things)} a ${Math.floor(Math.random() * 100) + 1}%!`);
}
};