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
+16 -13
View File
@@ -12,21 +12,24 @@ module.exports = class BanCommand extends Command {
memberName: 'ban',
description: 'Bans a user and logs the ban to the mod_logs.',
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to ban?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
return true;
args: [
{
key: 'member',
prompt: 'What member do you want to ban?',
type: 'member'
},
{
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
return true;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
}]
]
});
}
+16 -13
View File
@@ -9,21 +9,24 @@ module.exports = class KickCommand extends Command {
memberName: 'kick',
description: 'Kicks a user and logs the kick to the mod_logs.',
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to kick?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
return true;
args: [
{
key: 'member',
prompt: 'What member do you want to kick?',
type: 'member'
},
{
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
return true;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
}]
]
});
}
+13 -11
View File
@@ -8,17 +8,19 @@ module.exports = class LockdownCommand extends Command {
memberName: 'lockdown',
description: 'Locks down the current channel or removes a lockdown, which prevents non-administrator members from speaking.',
guildOnly: true,
args: [{
key: 'type',
prompt: 'Please enter either `start` or `stop`.',
type: 'string',
validate: type => {
if (['start', 'stop'].includes(type.toLowerCase()))
return true;
return 'Please enter either `start` or `stop`.';
},
parse: type => type.toLowerCase()
}]
args: [
{
key: 'type',
prompt: 'Please enter either `start` or `stop`.',
type: 'string',
validate: type => {
if (['start', 'stop'].includes(type.toLowerCase()))
return true;
return 'Please enter either `start` or `stop`.';
},
parse: type => type.toLowerCase()
}
]
});
}
+12 -9
View File
@@ -12,16 +12,19 @@ module.exports = class PruneCommand extends Command {
usages: 1,
duration: 60
},
args: [{
key: 'count',
prompt: 'How many messages do you want to delete? Limit of up to 99.',
type: 'integer',
validate: count => {
if (count < 100 && count > 0)
return true;
return `${count} is not a valid amount of messages. Limit 1-99.`;
args: [
{
key: 'count',
label: 'amount of messages',
prompt: 'How many messages do you want to delete? Limit of up to 99.',
type: 'integer',
validate: count => {
if (count < 100 && count > 0)
return true;
return `${count} is not a valid amount of messages. Limit 1-99.`;
}
}
}]
]
});
}
+16 -13
View File
@@ -9,21 +9,24 @@ module.exports = class SoftbanCommand extends Command {
memberName: 'softban',
description: 'Kicks a user and deletes their messages, and logs the softban to the mod_logs.',
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to softban?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
return true;
args: [
{
key: 'member',
prompt: 'What member do you want to softban?',
type: 'member'
},
{
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140) {
return true;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
}]
]
});
}
+21 -18
View File
@@ -12,25 +12,28 @@ module.exports = class UnbanCommand extends Command {
memberName: 'unban',
description: 'Unbans a user and logs the unban to the mod_logs.',
guildOnly: true,
args: [{
key: 'id',
prompt: 'What member do you want to unban? Please enter the ID of the user.',
type: 'string',
validate: id => {
if (id.length === 18)
return true;
return `${id} is not a valid ID. Please enter the user you wish to unban's ID.`;
args: [
{
key: 'id',
prompt: 'What member do you want to unban? Please enter the ID of the user.',
type: 'string',
validate: id => {
if (id.length === 18)
return true;
return `${id} is not a valid ID. Please enter the user you wish to unban's ID.`;
}
},
{
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140)
return true;
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
}
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140)
return true;
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
}]
]
});
}
+16 -13
View File
@@ -9,20 +9,23 @@ module.exports = class WarnCommand extends Command {
memberName: 'warn',
description: 'Warns a user and logs the warn to the mod_logs.',
guildOnly: true,
args: [{
key: 'member',
prompt: 'What member do you want to warn?',
type: 'member'
}, {
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140)
return true;
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
args: [
{
key: 'member',
prompt: 'What member do you want to warn?',
type: 'member'
},
{
key: 'reason',
prompt: 'What do you want to set the reason as?',
type: 'string',
validate: reason => {
if (reason.length < 140)
return true;
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
}
}
}]
]
});
}