mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Better Error Handling
This commit is contained in:
@@ -8,7 +8,7 @@ module.exports = class SoftbanCommand extends Command {
|
||||
name: 'softban',
|
||||
group: 'moderation',
|
||||
memberName: 'softban',
|
||||
description: 'Kicks a user and deletes their messages, and logs the softban to the mod_logs.',
|
||||
description: 'Kicks a user and deletes their messages, and logs the softban to the mod logs.',
|
||||
guildOnly: true,
|
||||
args: [
|
||||
{
|
||||
@@ -21,9 +21,8 @@ module.exports = class SoftbanCommand extends Command {
|
||||
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}.`;
|
||||
if(reason.length < 140) return true;
|
||||
return 'Invalid Reason. Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -70,7 +69,7 @@ module.exports = class SoftbanCommand extends Command {
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
} catch(err) {
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
return msg.say(`An Error Occurred: ${err}`);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user