fix: handle unauthorized guild roles by defaulting to an empty array

This commit is contained in:
2026-07-04 01:09:05 +07:00 Unverified
parent d8437ae39a
commit 48c4dae218
+1 -1
View File
@@ -73,7 +73,7 @@ export async function getDiscordMemberProfile(discordId: string) {
headers: { Authorization: `Bot ${token}` }, headers: { Authorization: `Bot ${token}` },
cache: "no-store", cache: "no-store",
}), }),
getGuildRoles() getGuildRoles().catch(() => []) // Fallback to empty array if unauthorized
]); ]);
if (!memberRes.ok) return null; if (!memberRes.ok) return null;