List in Ship

This commit is contained in:
Daniel Odendahl Jr
2017-07-08 00:47:06 +00:00
parent 63cea494ce
commit 329fdca633
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -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}%!`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "27.0.0",
"version": "27.0.1",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {