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(); }