mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 02:15:10 +02:00
Unban and fixes for the other mod commands
This commit is contained in:
+21
-10
@@ -17,7 +17,13 @@ module.exports = class WarnCommand extends commando.Command {
|
||||
}, {
|
||||
key: 'reason',
|
||||
prompt: 'What do you want to set the reason as?',
|
||||
type: 'string'
|
||||
type: 'string',
|
||||
validate: reason => {
|
||||
if (reason.length < 141) {
|
||||
return true;
|
||||
}
|
||||
return "Please keep your reason under 140 characters.";
|
||||
}
|
||||
}]
|
||||
});
|
||||
}
|
||||
@@ -33,14 +39,19 @@ module.exports = class WarnCommand extends commando.Command {
|
||||
let userToWarn = args.member;
|
||||
let reason = args.reason;
|
||||
if (!message.guild.channels.exists("name", "mod_logs")) return message.say(":x: Error! Could not find the mod_logs channel! Please create it!");
|
||||
let okHandMsg = await message.say(":ok_hand:");
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
|
||||
.setColor(0xFFFF00)
|
||||
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${userToWarn.user.username}#${userToWarn.user.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
|
||||
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
return [okHandMsg, modLogMsg];
|
||||
try {
|
||||
let okHandMsg = await message.say(":ok_hand:");
|
||||
const embed = new Discord.RichEmbed()
|
||||
.setAuthor(`${message.author.username}#${message.author.discriminator}`, message.author.avatarURL)
|
||||
.setColor(0xFFFF00)
|
||||
.setFooter('XiaoBot Moderation', this.client.user.avatarURL)
|
||||
.setTimestamp()
|
||||
.setDescription(`**Member:** ${userToWarn.user.username}#${userToWarn.user.discriminator} (${userToWarn.id})\n**Action:** Warn\n**Reason:** ${reason}`);
|
||||
let modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
return [okHandMsg, modLogMsg];
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(':x: Error! Something went wrong!');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user