Show rich embeds in message deletions logs
This commit is contained in:
parent
2824c6a991
commit
70591eec3b
2 changed files with 5 additions and 1 deletions
|
@ -28,7 +28,7 @@
|
|||
"ROLE_EDIT": "🖊 Role **{role.name}** (`{role.id}`) was edited",
|
||||
|
||||
"MESSAGE_EDIT": "✏ {userMention(member)} edited their message in {channelMention(channel)}:\nBefore:```{before}```After:```{after}```",
|
||||
"MESSAGE_DELETE": "🗑 Message from {userMention(member)} deleted in {channelMention(channel)} (originally posted at **{messageDate}**):\n```{messageText}```{attachments}",
|
||||
"MESSAGE_DELETE": "🗑 Message from {userMention(member)} deleted in {channelMention(channel)} (originally posted at **{messageDate}**):\n```{messageText}```{attachments}{embeds}",
|
||||
"MESSAGE_DELETE_BULK": "🗑 **{count}** messages deleted in {channelMention(channel)} ({archiveUrl})",
|
||||
"MESSAGE_DELETE_BARE": "🗑 Message (`{messageId}`) deleted in {channelMention(channel)} (no more info available)",
|
||||
|
||||
|
|
|
@ -462,6 +462,9 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
|
|||
? "\nAttachments:\n" + savedMessage.data.attachments.map((a: any) => a.url).join("\n")
|
||||
: "";
|
||||
|
||||
const richEmbed = (savedMessage.data.embeds || []).find(e => (e as Embed).type === "rich");
|
||||
const embeds = richEmbed ? "\nEmbeds:\n```" + disableCodeBlocks(JSON.stringify(richEmbed)) + "```" : "";
|
||||
|
||||
this.guildLogs.log(
|
||||
LogType.MESSAGE_DELETE,
|
||||
{
|
||||
|
@ -470,6 +473,7 @@ export class LogsPlugin extends ZeppelinPlugin<ILogsPluginConfig> {
|
|||
messageText: disableCodeBlocks(deactivateMentions(savedMessage.data.content || "<no text content>")),
|
||||
messageDate: moment(savedMessage.data.timestamp, "x").format(this.getConfig().format.timestamp),
|
||||
attachments: disableLinkPreviews(useMediaUrls(attachments)),
|
||||
embeds,
|
||||
},
|
||||
savedMessage.id,
|
||||
);
|
||||
|
|
Loading…
Add table
Reference in a new issue