From c317641dcef3b8752cdf6ac8d4024a6afc8685ff Mon Sep 17 00:00:00 2001 From: Navy Date: Thu, 10 Jun 2021 00:38:08 +0300 Subject: [PATCH] standardise msg delete and edit log formats --- .../client/components/observers/GuildLogging.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/structure/client/components/observers/GuildLogging.js b/structure/client/components/observers/GuildLogging.js index 797bd09..7844874 100644 --- a/structure/client/components/observers/GuildLogging.js +++ b/structure/client/components/observers/GuildLogging.js @@ -96,14 +96,15 @@ class GuildLogger extends Observer { const hook = await message.guild.getWebhook('messageLog'); const embed = { - author: { - name: `${message.author.tag} (${message.author.id})`, - icon_url: message.author.displayAvatarURL({ size: 32 }) //eslint-disable-line camelcase - }, + // author: { + // name: message.format('MSGLOG_DELETE_TITLE', { channel: message.channel.name, author: Util.escapeMarkdown(message.author.tag) }), //`${message.author.tag} (${message.author.id})`, + // icon_url: message.author.displayAvatarURL({ size: 32 }) //eslint-disable-line camelcase + // }, + title: message.format('MSGLOG_DELETE_TITLE', { channel: message.channel.name, author: Util.escapeMarkdown(message.author.tag) }), description: Util.escapeMarkdown(message.content)?.replace(/\\n/gu, ' ') || message.format('MSGLOG_NOCONTENT'), color: CONSTANTS.COLORS.RED, footer: { - text: `Message deleted in #${message.channel.name} | Message ID: ${message.id}` + text: message.format('MSGLOG_DELETE_FOOTER', { msgID: message.id, userID: message.author.id }) }, timestamp: message.createdAt }; @@ -370,6 +371,10 @@ class GuildLogger extends Observer { } else { const embed = { + // author: { + // name: oldMessage.format('MSGLOG_EDIT_TITLE', { author: Util.escapeMarkdown(author.tag), channel: channel.name }), + // icon_url: oldMessage.author.displayAvatarURL({ size: 32 }) // eslint-disable-line camelcase + // }, title: oldMessage.format('MSGLOG_EDIT_TITLE', { author: Util.escapeMarkdown(author.tag), channel: channel.name }), footer: { text: oldMessage.format('MSGLOG_EDIT_FOOTER', { msgID: oldMessage.id, userID: author.id })