From 89319539429ad707693fe358ee253870fd241e43 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Sun, 10 Sep 2017 01:30:12 +0000 Subject: [PATCH] Ship Name Command --- commands/text-edit/ship-name.js | 39 +++++++++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 40 insertions(+), 1 deletion(-) create mode 100644 commands/text-edit/ship-name.js diff --git a/commands/text-edit/ship-name.js b/commands/text-edit/ship-name.js new file mode 100644 index 00000000..df647809 --- /dev/null +++ b/commands/text-edit/ship-name.js @@ -0,0 +1,39 @@ +const Command = require('../../structures/Command'); + +module.exports = class ShipNameCommand extends Command { + constructor(client) { + super(client, { + name: 'ship-name', + group: 'text-edit', + memberName: 'ship-name', + description: 'Creates a ship name from two names.', + args: [ + { + key: 'start', + prompt: 'What name should be at the start of the ship name?', + type: 'string', + validate: start => { + if (start.length < 50) return true; + return 'The start name must be under 50 characters.'; + }, + parse: start => start.toLowerCase() + }, + { + key: 'end', + prompt: 'What name should be at the end of the ship name?', + type: 'string', + validate: end => { + if (end.length < 50) return true; + return 'The end name must be under 50 characters.'; + }, + parse: end => end.toLowerCase() + } + ] + }); + } + + run(msg, args) { + const { start, end } = args; + return msg.say(`${start.slice(0, Math.floor(start.length / 2))}${end.slice(Math.floor(end.length / 2))}`); + } +}; diff --git a/package.json b/package.json index 0caccf43..afa40cd6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "38.1.1", + "version": "38.2.0", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {