mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-03-15 05:41:51 +00:00
List message author IDs in bulk deletes logs (#109)
This commit is contained in:
parent
ec3bf2739d
commit
eb4d5ea6f1
2 changed files with 3 additions and 1 deletions
|
@ -30,7 +30,7 @@
|
|||
|
||||
"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_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_AUTO": "🗑 Auto-deleted message (`{message.id}`) from {userMention(user)} in {channelMention(channel)} (originally posted at **{messageDate}**):{messageSummary(message)}",
|
||||
|
||||
|
|
|
@ -8,11 +8,13 @@ export async function onMessageDeleteBulk(pluginData: GuildPluginData<LogsPlugin
|
|||
const channel = pluginData.guild.channels.get(savedMessages[0].channel_id);
|
||||
const archiveId = await pluginData.state.archives.createFromSavedMessages(savedMessages, pluginData.guild);
|
||||
const archiveUrl = pluginData.state.archives.getUrl(getBaseUrl(pluginData), archiveId);
|
||||
const authorIds = Array.from(new Set(savedMessages.map(item => `\`${item.user_id}\``))).join(', ');
|
||||
|
||||
pluginData.state.guildLogs.log(
|
||||
LogType.MESSAGE_DELETE_BULK,
|
||||
{
|
||||
count: savedMessages.length,
|
||||
authorIds,
|
||||
channel,
|
||||
archiveUrl,
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue