From 057982b739f734ed0615a9545992b9cde9ad2dbe Mon Sep 17 00:00:00 2001 From: Unknown Date: Sat, 24 Feb 2018 13:17:05 -0500 Subject: try this --- commands/ban.js | 17 +++++++++++++++++ commands/softban.js | 16 ++++++++++++++++ commands/warn.js | 1 + 3 files changed, 34 insertions(+) (limited to 'commands') diff --git a/commands/ban.js b/commands/ban.js index 8d794d2..33c9277 100644 --- a/commands/ban.js +++ b/commands/ban.js @@ -9,6 +9,23 @@ exports.run = async (bot, msg, args) => { await member.ban({ days: 7, reason: msg.author.tag + (reason ? ': ' + reason : '') }) .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); msg.channel.send(`Alright, I banned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + + const { RichEmbed } = require('discord.js'); + try { + const embed = new RichEmbed() + .setColor(0x00ae86) + .setAuthor(member.user.tag, member.user.avatarURL) + .setTitle(`:hammer: **${member.user.tag}**`) + .setDescription(`*${member.user.tag}}* was banned from the server by *${msg.author.tag}*.`) + .addField('Reason', reason) + .addField('Moderator', msg.author.tag) + .setTimestamp() + .setFooter(`${msg.author.tag} banned ${member.user.tag}`, msg.author.avatarURL); + msg.guild.channels.find('name', 'logs').send({ embed }); + } + catch (err) { + console.error(err.stack); + } }; exports.conf = { diff --git a/commands/softban.js b/commands/softban.js index d17b8c1..ff5d4b5 100644 --- a/commands/softban.js +++ b/commands/softban.js @@ -10,6 +10,22 @@ exports.run = async (bot, msg, args) => { .catch(err => { msg.reply('There was an error.'); console.error(err.stack);}); await msg.guild.unban(member.user.id).catch(msg.reply('There was an error.')); msg.channel.send(`Alright, I softbanned **${member.user.tag}**${(reason ? ` for the reason **${reason}**.` : '.')}`); + const { RichEmbed } = require('discord.js'); + try { + const embed = new RichEmbed() + .setColor(0x00ae86) + .setAuthor(member.user.tag, member.user.avatarURL) + .setTitle(`:hammer: **${member.user.tag}**`) + .setDescription(`*${member.user.tag}}* was softbanned from the server by *${msg.author.tag}*.`) + .addField('Reason', reason) + .addField('Moderator', msg.author.tag) + .setTimestamp() + .setFooter(`${msg.author.tag} softbanned ${member.user.tag}`, msg.author.avatarURL); + msg.guild.channels.find('name', 'logs').send({ embed }); + } + catch (err) { + console.error(err.stack); + } }; exports.conf = { diff --git a/commands/warn.js b/commands/warn.js index e16cd08..a20cf08 100644 --- a/commands/warn.js +++ b/commands/warn.js @@ -11,6 +11,7 @@ exports.run = (bot, msg, args) => { new RichEmbed() .setColor(0x00ae86) .setTitle(':warning: Warning') + .setAuthor(victim.user.tag, victim.user.avatarURL) .addField('Warning Reason', warnReason) .addField('ID', victim.id, true) .addField('Created Account', victim.user.createdAt, true) -- cgit v1.2.3