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

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