mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-21 22:14:34 +02:00
Another Rewrite Type Thing
This commit is contained in:
@@ -36,19 +36,18 @@ module.exports = class WarnCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES'])) return;
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission('EMBED_LINKS')) return message.say(':x: Error! I don\'t have the Embed Links Permission!');
|
||||
}
|
||||
const userToWarn = args.member;
|
||||
const member = args.member;
|
||||
const 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!');
|
||||
try {
|
||||
const okHandMsg = await message.say(':ok_hand:');
|
||||
await message.say(':ok_hand:');
|
||||
const embed = new 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}`);
|
||||
const modLogMsg = await message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
return [okHandMsg, modLogMsg];
|
||||
.setDescription(`**Member:** ${member.user.username}#${member.user.discriminator} (${member.id})\n**Action:** Warn\n**Reason:** ${reason}`);
|
||||
return message.guild.channels.find('name', 'mod_logs').sendEmbed(embed);
|
||||
}
|
||||
catch (err) {
|
||||
return message.say(':x: Error! Something went wrong!');
|
||||
|
||||
Reference in New Issue
Block a user