From 347d1423fcfc0909bcd12381560c3836ce1b6331 Mon Sep 17 00:00:00 2001 From: Nuno Duque Nunes Date: Thu, 11 Jun 2026 04:44:20 +0100 Subject: [PATCH] fix format.char() --- src/systems/format.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/systems/format.ts b/src/systems/format.ts index e6fed28..529ecb8 100644 --- a/src/systems/format.ts +++ b/src/systems/format.ts @@ -1,4 +1,4 @@ -import { Character, ClassKey, CharacterClass, Nation } from "@src/types"; +import { Character, CharacterClass, Nation } from "@src/types"; import { Emoji } from "@systems/emojis"; import { WRankEntry } from "@systems/wrank"; @@ -18,13 +18,11 @@ function charButton(c: Character, options?: { shared?: boolean }): string { * Format a character for display in embeds and messages. * Output: <:class:> 79 «Flash» */ -function char( - c: { class: ClassKey|CharacterClass; level: number; name: string }, - options?: CharDisplayOptions -): string { + function char(c: Character, options?: CharDisplayOptions): string { const showEmoji = options?.emoji ?? true; const showLevel = options?.level ?? true; - const classStr = showEmoji ? (Emoji.class(c.class) || c.class) : c.class; + const classKey = c.class.key; + const classStr = showEmoji ? (Emoji.class(classKey) || classKey) : classKey; const levelStr = showLevel ? `${c.level} ` : ""; return `${classStr} ${levelStr}${c.name}`.trim(); }