mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 01:53:51 +02:00
Make Code Prettier
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class UnbanCommand extends Command {
|
||||
prompt: 'What member do you want to unban? Please enter the ID of the user.',
|
||||
type: 'string',
|
||||
validate: id => {
|
||||
if (id.length === 18)
|
||||
if(id.length === 18)
|
||||
return true;
|
||||
return `${id} is not a valid ID. Please enter the user you wish to unban's ID.`;
|
||||
}
|
||||
@@ -29,7 +29,7 @@ module.exports = class UnbanCommand extends Command {
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: reason => {
|
||||
if (reason.length < 140)
|
||||
if(reason.length < 140)
|
||||
return true;
|
||||
return `Please keep your reason under 140 characters, you have ${reason.length}.`;
|
||||
}
|
||||
@@ -43,16 +43,16 @@ module.exports = class UnbanCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, args) {
|
||||
if (!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
if(!msg.channel.permissionsFor(this.client.user).has('BAN_MEMBERS'))
|
||||
return msg.say('This Command requires the `Ban Members` Permission.');
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog', 'mod_logs'));
|
||||
if (!modlogs)
|
||||
if(!modlogs)
|
||||
return msg.say('This Command requires a channel set with the `modchannel` command.');
|
||||
if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
if(!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS'))
|
||||
return msg.say('This Command requires the `Embed Links` Permission.');
|
||||
const { id, reason } = args;
|
||||
const bans = await msg.guild.fetchBans();
|
||||
if (!bans.has(id))
|
||||
if(!bans.has(id))
|
||||
return msg.say('This ID is not in the Guild Banlist.');
|
||||
const member = bans.get(id);
|
||||
try {
|
||||
@@ -67,8 +67,8 @@ module.exports = class UnbanCommand extends Command {
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({embed});
|
||||
} catch (err) {
|
||||
return modlogs.send({ embed });
|
||||
} catch(err) {
|
||||
return msg.say('An Unknown Error Occurred.');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user