standardise msg delete and edit log formats

This commit is contained in:
Erik 2021-06-10 00:38:08 +03:00
parent 0ec6e75959
commit c317641dce
No known key found for this signature in database
GPG Key ID: 7E862371D3409F16

View File

@ -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 })