mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-19 21:40:51 +02:00
List in Ship
This commit is contained in:
@@ -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}%!`);
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user