From 329fdca633f4ce78457490e11cab0cf00e9195ed Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sat, 8 Jul 2017 00:47:06 +0000 Subject: [PATCH] List in Ship --- commands/random-res/ship.js | 3 ++- package.json | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/commands/random-res/ship.js b/commands/random-res/ship.js index 609c3654..4148a9e9 100644 --- a/commands/random-res/ship.js +++ b/commands/random-res/ship.js @@ -21,6 +21,7 @@ module.exports = class ShipCommand extends Command { run(msg, args) { const { things } = args; const rating = Math.floor(Math.random() * 100) + 1; - return msg.say(`I'd give ${things.join(' and ')} a ${rating}%!`); + const list = `${things.slice(0, -1).join(', ')}${things.length > 1 ? ' and ' : ''}${things.slice(-1)}`; + return msg.say(`I'd give ${list} a ${rating}%!`); } }; diff --git a/package.json b/package.json index 352ca2e2..b8ee5cdb 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "27.0.0", + "version": "27.0.1", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {