From 986e23fe6dbfec07d5d58db1e7013a91eac786d0 Mon Sep 17 00:00:00 2001 From: Tarrgon <61888458+Tarrgon@users.noreply.github.com> Date: Sun, 9 Nov 2025 15:19:33 -0500 Subject: [PATCH] Update nickname formatting --- package.json | 2 +- src/utils/audit-log-utils.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index a9a50f2..568d3a9 100644 --- a/package.json +++ b/package.json @@ -29,6 +29,6 @@ "start": "node dist/index.js", "build": "npm run clean && npx tsc && npm run copyfiles", "clean": "npx rimraf dist", - "copyfiles": "npx copyfiles -u 1 \"./src/**/*.html\" ./dist" + "copyfiles": "npx copyfiles -u 1 \"./src/**/*.ejs\" ./dist" } } diff --git a/src/utils/audit-log-utils.ts b/src/utils/audit-log-utils.ts index caac603..49462d8 100644 --- a/src/utils/audit-log-utils.ts +++ b/src/utils/audit-log-utils.ts @@ -112,13 +112,16 @@ function formatChange(change: AuditLogChange, entry: GuildAuditLogsEntry): strin return formatPermissionOrOverwrites(change as PermissionsChangeLog); } + const oldValue = change.key == 'nick' ? `\`${change.old}\`` : change.old; + const newValue = change.key == 'nick' ? `\`${change.new}\`` : change.new; + if (change.new !== undefined && change.old === undefined) - return `Set ${change.key} to ${change.new}`; + return `Set ${change.key} to ${newValue}`; if (change.new === undefined && change.old !== undefined) - return `Set ${change.key} with value ${change.old} to default/null`; + return `Set ${change.key} with value ${oldValue} to default/null`; - return `Set ${change.key} from ${change.old} to ${change.new}`; + return `Set ${change.key} from ${oldValue} to ${newValue}`; } function formatApplicationPermissionsUpdate(change: ApplicationCommandPermissionChangeLog): string | undefined {