3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-03-15 05:41:51 +00:00

Show rich embeds in message deletions logs

This commit is contained in:
Dragory 2019-04-30 05:35:19 +03:00
parent 2824c6a991
commit 70591eec3b
2 changed files with 5 additions and 1 deletions

View file

@ -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)",

View file

@ -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,
);