Update nickname formatting

This commit is contained in:
Tarrgon
2025-11-09 15:19:33 -05:00
parent 916bf519d4
commit 986e23fe6d
2 changed files with 7 additions and 4 deletions
+1 -1
View File
@@ -29,6 +29,6 @@
"start": "node dist/index.js", "start": "node dist/index.js",
"build": "npm run clean && npx tsc && npm run copyfiles", "build": "npm run clean && npx tsc && npm run copyfiles",
"clean": "npx rimraf dist", "clean": "npx rimraf dist",
"copyfiles": "npx copyfiles -u 1 \"./src/**/*.html\" ./dist" "copyfiles": "npx copyfiles -u 1 \"./src/**/*.ejs\" ./dist"
} }
} }
+6 -3
View File
@@ -112,13 +112,16 @@ function formatChange(change: AuditLogChange, entry: GuildAuditLogsEntry): strin
return formatPermissionOrOverwrites(change as PermissionsChangeLog); 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) 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) 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 { function formatApplicationPermissionsUpdate(change: ApplicationCommandPermissionChangeLog): string | undefined {