3
0
Fork 0
mirror of https://github.com/ZeppelinBot/Zeppelin.git synced 2025-05-19 16:05:01 +00:00

List Message Author IDs in Bulk Deletes Logs

This makes searching for deleted messages by a certain User ID a lot easier
This commit is contained in:
Jonathan B 2020-09-08 00:19:49 +02:00
parent 69a1df260e
commit 731f007374
2 changed files with 3 additions and 1 deletions

View file

@ -30,7 +30,7 @@
"MESSAGE_EDIT": "✏ {userMention(user)} edited their message (`{after.id}`) in {channelMention(channel)}:\n**Before:**{messageSummary(before)}**After:**{messageSummary(after)}", "MESSAGE_EDIT": "✏ {userMention(user)} edited their message (`{after.id}`) in {channelMention(channel)}:\n**Before:**{messageSummary(before)}**After:**{messageSummary(after)}",
"MESSAGE_DELETE": "🗑 Message (`{message.id}`) from {userMention(user)} deleted in {channelMention(channel)} (originally posted at **{messageDate}**):{messageSummary(message)}", "MESSAGE_DELETE": "🗑 Message (`{message.id}`) from {userMention(user)} deleted in {channelMention(channel)} (originally posted at **{messageDate}**):{messageSummary(message)}",
"MESSAGE_DELETE_BULK": "🗑 **{count}** messages deleted in {channelMention(channel)} ({archiveUrl})", "MESSAGE_DELETE_BULK": "🗑 **{count}** messages by {authorIds} deleted in {channelMention(channel)} ({archiveUrl})",
"MESSAGE_DELETE_BARE": "🗑 Message (`{messageId}`) deleted in {channelMention(channel)} (no more info available)", "MESSAGE_DELETE_BARE": "🗑 Message (`{messageId}`) deleted in {channelMention(channel)} (no more info available)",
"MESSAGE_DELETE_AUTO": "🗑 Auto-deleted message (`{message.id}`) from {userMention(user)} in {channelMention(channel)} (originally posted at **{messageDate}**):{messageSummary(message)}", "MESSAGE_DELETE_AUTO": "🗑 Auto-deleted message (`{message.id}`) from {userMention(user)} in {channelMention(channel)} (originally posted at **{messageDate}**):{messageSummary(message)}",

View file

@ -8,11 +8,13 @@ export async function onMessageDeleteBulk(pluginData: PluginData<LogsPluginType>
const channel = pluginData.guild.channels.get(savedMessages[0].channel_id); const channel = pluginData.guild.channels.get(savedMessages[0].channel_id);
const archiveId = await pluginData.state.archives.createFromSavedMessages(savedMessages, pluginData.guild); const archiveId = await pluginData.state.archives.createFromSavedMessages(savedMessages, pluginData.guild);
const archiveUrl = pluginData.state.archives.getUrl(getBaseUrl(pluginData), archiveId); const archiveUrl = pluginData.state.archives.getUrl(getBaseUrl(pluginData), archiveId);
const authorIds = Array.from(new Set(savedMessages.map(item => item.user_id)))
pluginData.state.guildLogs.log( pluginData.state.guildLogs.log(
LogType.MESSAGE_DELETE_BULK, LogType.MESSAGE_DELETE_BULK,
{ {
count: savedMessages.length, count: savedMessages.length,
authorIds,
channel, channel,
archiveUrl, archiveUrl,
}, },