Cleaner Looking args

This commit is contained in:
Daniel Odendahl Jr
2017-05-02 17:54:07 +00:00
parent 57ee7fa82b
commit 3bb21c2df0
83 changed files with 787 additions and 616 deletions
+13 -11
View File
@@ -14,17 +14,19 @@ module.exports = class BinaryCommand extends Command {
group: 'textedit',
memberName: 'binary',
description: 'Converts text to binary.',
args: [{
key: 'text',
prompt: 'What text would you like to convert to binary?',
type: 'string',
validate: text => {
if (binary(text).length < 2000)
return true;
return 'Your message content is too long.';
},
parse: text => binary(text)
}]
args: [
{
key: 'text',
prompt: 'What text would you like to convert to binary?',
type: 'string',
validate: text => {
if (binary(text).length < 2000)
return true;
return 'Your message content is too long.';
},
parse: text => binary(text)
}
]
});
}
+11 -9
View File
@@ -7,16 +7,18 @@ module.exports = class CowsayCommand extends Command {
group: 'textedit',
memberName: 'cowsay',
description: 'Converts text to cowsay.',
args: [{
key: 'text',
prompt: 'What text would you like the cow to say?',
type: 'string',
validate: text => {
if (text.length < 1500)
return true;
return `Please keep your content under 1500 characters, you have ${text.length}.`;
args: [
{
key: 'text',
prompt: 'What text would you like the cow to say?',
type: 'string',
validate: text => {
if (text.length < 1500)
return true;
return `Please keep your content under 1500 characters, you have ${text.length}.`;
}
}
}]
]
});
}
+7 -5
View File
@@ -8,11 +8,13 @@ module.exports = class EmbedCommand extends Command {
group: 'textedit',
memberName: 'embed',
description: 'Sends a message in an embed.',
args: [{
key: 'text',
prompt: 'What text would you like to embed?',
type: 'string'
}]
args: [
{
key: 'text',
prompt: 'What text would you like to embed?',
type: 'string'
}
]
});
}
+13 -11
View File
@@ -9,17 +9,19 @@ module.exports = class MorseCommand extends Command {
group: 'textedit',
memberName: 'morse',
description: 'Translates text to morse code.',
args: [{
key: 'text',
prompt: 'What text would you like to convert to morse?',
type: 'string',
validate: text => {
if (letterTrans(text, dictionary, ' ').length < 1999)
return true;
return 'Your message content is too long.';
},
parse: text => letterTrans(text.toLowerCase(), dictionary, ' ')
}]
args: [
{
key: 'text',
prompt: 'What text would you like to convert to morse?',
type: 'string',
validate: text => {
if (letterTrans(text, dictionary, ' ').length < 1999)
return true;
return 'Your message content is too long.';
},
parse: text => letterTrans(text.toLowerCase(), dictionary, ' ')
}
]
});
}
+13 -11
View File
@@ -9,17 +9,19 @@ module.exports = class PirateCommand extends Command {
group: 'textedit',
memberName: 'pirate',
description: 'Talk like a pirate!',
args: [{
key: 'text',
prompt: 'What text would you like to convert to pirate?',
type: 'string',
validate: text => {
if (wordTrans(text, dictionary).length < 1999)
return true;
return 'Your message content is too long.';
},
parse: text => wordTrans(text, dictionary)
}]
args: [
{
key: 'text',
prompt: 'What text would you like to convert to pirate?',
type: 'string',
validate: text => {
if (wordTrans(text, dictionary).length < 1999)
return true;
return 'Your message content is too long.';
},
parse: text => wordTrans(text, dictionary)
}
]
});
}
+8 -6
View File
@@ -7,12 +7,14 @@ module.exports = class ReverseCommand extends Command {
group: 'textedit',
memberName: 'reverse',
description: 'Reverses text.',
args: [{
key: 'text',
prompt: 'What text would you like to reverse?',
type: 'string',
parse: text => text.split('').reverse().join('')
}]
args: [
{
key: 'text',
prompt: 'What text would you like to reverse?',
type: 'string',
parse: text => text.split('').reverse().join('')
}
]
});
}
+7 -5
View File
@@ -13,11 +13,13 @@ module.exports = class SayCommand extends Command {
memberName: 'say',
description: 'Make XiaoBot say what you wish.',
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like XiaoBot to say?',
type: 'string'
}]
args: [
{
key: 'text',
prompt: 'What text would you like XiaoBot to say?',
type: 'string'
}
]
});
}
+13 -11
View File
@@ -9,17 +9,19 @@ module.exports = class TemmieCommand extends Command {
group: 'textedit',
memberName: 'temmie',
description: 'Translate text to Temmie speak.',
args: [{
key: 'text',
prompt: 'What text would you like to convert to Temmie speak?',
type: 'string',
validate: text => {
if (wordTrans(text, dictionary).length < 1999)
return true;
return 'Your message content is too long.';
},
parse: text => wordTrans(text, dictionary)
}]
args: [
{
key: 'text',
prompt: 'What text would you like to convert to Temmie speak?',
type: 'string',
validate: text => {
if (wordTrans(text, dictionary).length < 1999)
return true;
return 'Your message content is too long.';
},
parse: text => wordTrans(text, dictionary)
}
]
});
}
+8 -6
View File
@@ -12,12 +12,14 @@ module.exports = class UpsideDownCommand extends Command {
group: 'textedit',
memberName: 'upsidedown',
description: 'Flips text upside-down.',
args: [{
key: 'text',
prompt: 'What text would you like to flip upside-down?',
type: 'string',
parse: text => letterTrans(text, dictionary)
}]
args: [
{
key: 'text',
prompt: 'What text would you like to flip upside-down?',
type: 'string',
parse: text => letterTrans(text, dictionary)
}
]
});
}
+9 -9
View File
@@ -13,11 +13,13 @@ module.exports = class WebhookCommand extends Command {
memberName: 'webhook',
description: 'Posts a message to the webhook defined in your `process.env`.',
guildOnly: true,
args: [{
key: 'text',
prompt: 'What text would you like the webhook to say?',
type: 'string'
}]
args: [
{
key: 'content',
prompt: 'What text would you like the webhook to say?',
type: 'string'
}
]
});
}
@@ -28,14 +30,12 @@ module.exports = class WebhookCommand extends Command {
async run(msg, args) {
if (!msg.channel.permissionsFor(this.client.user).has('MANAGE_MESSAGES'))
return msg.say('This Command requires the `Manage Messages` Permission.');
const { text } = args;
const { content } = args;
try {
msg.delete();
await request
.post(process.env.WEBHOOK_URL)
.send({
content: text
});
.send({content});
return null;
} catch (err) {
return msg.say('An Unknown Error Occurred.');
+14 -12
View File
@@ -8,18 +8,20 @@ module.exports = class ZalgoCommand extends Command {
group: 'textedit',
memberName: 'zalgo',
description: 'Zalgoizes Text.',
args: [{
key: 'text',
prompt: 'What text would you like to convert to zalgo?',
type: 'string',
validate: text => {
if (text.length < 500) {
return true;
}
return `Please keep your text under 500 characters, you have ${text.length}.`;
},
parse: text => zalgo(text)
}]
args: [
{
key: 'text',
prompt: 'What text would you like to convert to zalgo?',
type: 'string',
validate: text => {
if (text.length < 500) {
return true;
}
return `Please keep your text under 500 characters, you have ${text.length}.`;
},
parse: text => zalgo(text)
}
]
});
}