mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-17 21:40:51 +02:00
Cleaner Looking args
This commit is contained in:
+16
-13
@@ -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
@@ -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}.`;
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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,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.`;
|
||||
}
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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}.`;
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -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
@@ -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}.`;
|
||||
}
|
||||
}
|
||||
}]
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user