logging: thread update

This commit is contained in:
Cynthia Foxwell 2025-04-23 21:58:49 -06:00
parent 445ff2b118
commit ec1105eb59
Signed by: Cynosphere
SSH key fingerprint: SHA256:H3SM8ufP/uxqLwKSH7xY89TDnbR9uOHzjLoBr0tlajk

View file

@ -53,7 +53,6 @@ events.add("guildAuditLogEntryCreate", "logging", async function (entry) {
case AuditLogActions.GUILD_SCHEDULED_EVENT_UPDATE:
case AuditLogActions.GUILD_SCHEDULED_EVENT_DELETE:
case AuditLogActions.THREAD_CREATE:
case AuditLogActions.THREAD_UPDATE:
case AuditLogActions.THREAD_DELETE:
case AuditLogActions.APPLICATION_COMMAND_PERMISSION_UPDATE:
case AuditLogActions.ONBOARDING_PROMPT_CREATE:
@ -102,6 +101,37 @@ events.add("guildAuditLogEntryCreate", "logging", async function (entry) {
.catch(() => {});
break;
}
case AuditLogActions.THREAD_UPDATE: {
channel
.createMessage({
embeds: [
{
color: COLOR_CHANGED,
title: `Thread Updated`,
description: `<#${entry.targetID}> (${entry.target.name})`,
timestamp: new Date().toISOString(),
fields: [
entry.after.name != null && {
name: "Name",
value: `\`${entry.before.name}\` -> \`${entry.after.name}\``,
},
entry.after.auto_archive_duration != null && {
name: "Hide After Inactivity",
value: `\`${entry.before.auto_archive_duration}\` -> \`${entry.after.auto_archive_duration}\``,
},
entry.after.rate_limit_per_user != null && {
name: "Slowmode",
value: `\`${entry.rate_limit_per_user}\` -> \`${entry.after.rate_limit_per_user}\``,
},
].filter((x) => !!x),
footer: {
text: `Thread ID: ${entry.targetID}`,
},
},
],
})
.catch(() => {});
}
}
});