···1616}
17171818// Build the discordId we key the Player on. Players who linked Discord to
1919-// start.gg expose `user.discordId`; everyone else gets a stable synthetic id
2020-// derived from the start.gg participant id so the record is addressable and
2121-// staff can later edit in the real Discord id.
1919+// start.gg expose `discordId` (from their DISCORD ProfileAuthorization);
2020+// everyone else gets a stable synthetic id derived from the start.gg
2121+// participant id so the record is addressable and staff can later edit in the
2222+// real Discord id.
2223function playerDiscordId(p: StartggParticipant): string {
2323- return p.user?.discordId ?? `startgg:${p.id}`;
2424+ return p.discordId ?? `startgg:${p.id}`;
2425}
25262627async function upsertParticipant(p: StartggParticipant, eventId: string): Promise<{ imported: boolean; linked: boolean }> {
···8990 const p = participants[i]!;
9091 const result = await upsertParticipant(p, eventId);
9192 if (result.imported) imported++;
9292- if (!p.user?.discordId) needDiscord++;
9393+ if (!p.discordId) needDiscord++;
9394 emitTaskProgress({
9495 taskId,
9596 stage: 'importing',