From 399e484c58a1bc88be92898b0592e5270636aca5 Mon Sep 17 00:00:00 2001 From: chris062689 Date: Fri, 7 Apr 2017 19:17:05 -0400 Subject: [PATCH] Updated ban code for proper logging of username in message. --- commands/ban.js | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/commands/ban.js b/commands/ban.js index f1fc43d..cbaf640 100644 --- a/commands/ban.js +++ b/commands/ban.js @@ -4,20 +4,20 @@ var data = require('../data.js'); var logger = require('../logging.js'); var UserBan = require('../models/UserBan.js'); -exports.roles = ['Admins', 'Moderators', 'Secret', 'CitraBot']; +exports.roles = ['Admins', 'Moderators', 'CitraBot']; exports.command = function(message) { message.mentions.users.map((user) => { var count = app.warnings.filter(x => x.id == user.id && !x.cleared).length || 0; - message.channel.sendMessage(`${user} You will now be banned from this channel.`); - logger.info(`${message.author.toString()} has banned ${user.toString()}.`); - app.logChannel.sendMessage(`${message.author} has banned ${user} [${count} + 1].`); + message.channel.sendMessage(`${user} ${user.username}, You will now be banned from this channel.`); + logger.info(`${message.author.toString()} has banned ${user.toString()} ${user} ${user.username}.`); + app.logChannel.sendMessage(`${message.author} has banned ${user} ${user.username} [${count}].`); app.bans.push(new UserBan(user.id, user.username, message.author.id, message.author.username, count)); message.guild.member(user).ban().catch(function (error) { - app.logChannel.sendMessage(`Error banning ${user.toString()}`); - logger.error(`Error banning ${user.toString()}.`, error); + app.logChannel.sendMessage(`Error banning ${user} ${user.username}`); + logger.error(`Error banning ${user.toString()} ${user} ${user.username}.`, error); }); data.flushBans(); });