mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 21:44:48 +02:00
Fix Everything
This commit is contained in:
@@ -24,11 +24,8 @@ module.exports = class UnbanCommand extends Command {
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string',
|
||||
validate: (reason) => {
|
||||
if (reason.length < 140) {
|
||||
return true;
|
||||
} else {
|
||||
return 'Invalid Reason. Reason must be under 140 characters.';
|
||||
}
|
||||
if (reason.length < 140) return true;
|
||||
else return 'Reason must be under 140 characters.';
|
||||
}
|
||||
}
|
||||
]
|
||||
@@ -39,9 +36,7 @@ module.exports = class UnbanCommand extends Command {
|
||||
const modlogs = msg.guild.channels.get(msg.guild.settings.get('modLog'));
|
||||
const { id, reason } = args;
|
||||
const bans = await msg.guild.fetchBans();
|
||||
if (!bans.has(id)) {
|
||||
return msg.say('This ID is not in the Guild Banlist.');
|
||||
}
|
||||
if (!bans.has(id)) return msg.say('This ID is not in the Guild Banlist.');
|
||||
const member = bans.get(id).user;
|
||||
try {
|
||||
await msg.say(`Are you sure you want to unban ${member.tag} (${member.id})?`);
|
||||
@@ -50,32 +45,29 @@ module.exports = class UnbanCommand extends Command {
|
||||
time: 15000,
|
||||
errors: ['time']
|
||||
});
|
||||
if (['y', 'yes'].includes(collected.first().content.toLowerCase())) {
|
||||
await msg.guild.unban(member, `${msg.author.tag}: ${reason}`);
|
||||
await msg.say(`Successfully unbanned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user.has('SEND_MESSAGES'))) {
|
||||
return msg.say('Could not log the unban to the mod logs.');
|
||||
} else if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
return modlogs.send(stripIndents`
|
||||
if (!['y', 'yes'].includes(collected.first().content.toLowerCase())) return msg.say('Aborting Unban.');
|
||||
await msg.guild.unban(member, `${msg.author.tag}: ${reason}`);
|
||||
await msg.say(`Successfully unbanned ${member.user.tag}.`);
|
||||
if (!modlogs || !modlogs.permissionsFor(this.client.user.has('SEND_MESSAGES'))) {
|
||||
return msg.say('Could not log the unban to the mod logs.');
|
||||
} else if (!modlogs.permissionsFor(this.client.user).has('EMBED_LINKS')) {
|
||||
return modlogs.send(stripIndents`
|
||||
**Member:** ${member.tag} (${member.id})
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
} else {
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.tag} (${member.id})
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
**Moderator:** ${msg.author.tag}
|
||||
`);
|
||||
} else {
|
||||
const embed = new RichEmbed()
|
||||
.setAuthor(msg.author.tag, msg.author.displayAvatarURL)
|
||||
.setColor(0x00AE86)
|
||||
.setTimestamp()
|
||||
.setDescription(stripIndents`
|
||||
**Member:** ${member.tag} (${member.id})
|
||||
**Action:** Unban
|
||||
**Reason:** ${reason}
|
||||
`);
|
||||
return modlogs.send({ embed });
|
||||
}
|
||||
} else {
|
||||
return msg.say('Aborting Unban.');
|
||||
return modlogs.send({ embed });
|
||||
}
|
||||
} catch (err) {
|
||||
return msg.say('Aborting Unban.');
|
||||
|
||||
Reference in New Issue
Block a user