Ship Name Command

This commit is contained in:
Daniel Odendahl Jr
2017-09-10 01:30:12 +00:00
parent fc3088d0bb
commit 8931953942
2 changed files with 40 additions and 1 deletions
+39
View File
@@ -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))}`);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "38.1.1",
"version": "38.2.0",
"description": "Your personal server companion.",
"main": "Shard.js",
"scripts": {