From 40acaa7d8ba2295893e1810f46f081ca2ba07794 Mon Sep 17 00:00:00 2001 From: Maaxxs <61059039+MaaxxsDev@users.noreply.github.com> Date: Sat, 19 Sep 2026 14:06:52 +0200 Subject: [PATCH] Show real Discord names in Premades instead of raw user IDs Members without a linked website account showed as "Discord-Nutzer " since the site had no way to resolve their name. The bot API's GET /api/premades now resolves display names via its own Discord cache (owner_name per premade, name per member) - premade_name_for() prefers that API-provided name, falling back to the linked website account and finally the raw ID only if both are unavailable (e.g. bot offline at request time). Requires the matching api.py update (Aion2_RaidPlaner, not part of this repo) to be deployed and the bot restarted, otherwise the API just omits the new fields and the existing fallbacks apply. Co-Authored-By: Claude Sonnet 5 --- premades.php | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/premades.php b/premades.php index 8fc8795..8f205f0 100644 --- a/premades.php +++ b/premades.php @@ -37,8 +37,14 @@ if (!empty($allDiscordIds)) { } } -function premade_name_for(int $discordId, array $namesByDiscordId): string +// Bevorzugt den von der Bot-API aufgeloesten Discord-Anzeigenamen (die API kennt Discord direkt, +// die Website nicht); faellt auf den verknuepften Website-Account und zuletzt auf die rohe +// Discord-ID zurueck, falls beides fehlt (z.B. Bot offline beim API-Aufruf). +function premade_name_for(int $discordId, array $namesByDiscordId, ?string $apiName = null): string { + if ($apiName !== null && $apiName !== '') { + return $apiName; + } return $namesByDiscordId[$discordId] ?? ('Discord-Nutzer ' . $discordId); } @@ -85,7 +91,7 @@ include __DIR__ . '/includes/header.php';
Einladung zu - von + von
@@ -141,7 +147,7 @@ include __DIR__ . '/includes/header.php';

⚔️

- 👑 + 👑 Mitglieder
@@ -149,7 +155,7 @@ include __DIR__ . '/includes/header.php';
  • - + @@ -163,7 +169,7 @@ include __DIR__ . '/includes/header.php';
  • - ⏳ (Einladung offen) + ⏳ (Einladung offen) @@ -214,7 +220,7 @@ include __DIR__ . '/includes/header.php';