diff --git a/src/commands/commands/events.command.ts b/src/commands/commands/events.command.ts index 5a6fdde..d2b1d2d 100644 --- a/src/commands/commands/events.command.ts +++ b/src/commands/commands/events.command.ts @@ -1137,7 +1137,7 @@ export class EventsCommand extends AdminCommand { }; static async events_winners(inter: SlashInteraction) { - await inter.deferReply({ ephemeral: true }); + await inter.deferReply(); const event = await EventsCommand.WINNERS_OPTIONS.event.get(inter); const grouped = groupWinnersByRoom(Queries.selectManyEventWinners({ guildId: inter.guildId, eventId: event.id })); @@ -1224,7 +1224,8 @@ export class EventsCommand extends AdminCommand { "**Declaring winners** — crown a room's winner(s) with one shared role that auto-revokes when the event's next occurrence opens:\n" + `- Configure the role once via \`winner_role\` on ${commandMention("events", "set")}.\n` + `- ${commandMention("events", "declare-winners")} (\`room_index\`, \`winner_1\`..\`winner_5\`) grants it — additive, ties allowed; call again for >5 winners.\n` + - `- ${commandMention("events", "winners")} lists winners per room; ${commandMention("events", "clear-winners")} (optional \`room_index\`) revokes early.\n\n` + + `- ${commandMention("events", "winners")} lists winners per room; ${commandMention("events", "clear-winners")} (optional \`room_index\`) revokes early.\n` + + "- With multiple occurrences scheduled, the **earliest** one to open revokes the role.\n\n" + "**Auto-pull subs at room start:**\n" + "- `auto_pull_subs_at_room_start_toggle` (default `false`) — at each room's start, lock paired sub and pull subs into the room. Forces room lock at exact `start_time` (ignores `lock_offset`).\n" + "- `shuffle_subs_before_auto_pull_toggle` (default `false`) — shuffle the sub queue before the pull.\n" + diff --git a/src/db/queries.ts b/src/db/queries.ts index 587520f..ef803b9 100644 --- a/src/db/queries.ts +++ b/src/db/queries.ts @@ -1257,6 +1257,7 @@ export namespace Queries { eq(EVENT_WINNER_TABLE.guildId, sql.placeholder("guildId")), eq(EVENT_WINNER_TABLE.eventId, sql.placeholder("eventId")) )) + .orderBy(EVENT_WINNER_TABLE.id) .prepare(); // Event Defaults diff --git a/src/utils/winner.logic.ts b/src/utils/winner.logic.ts index fd0dc16..6ad529f 100644 --- a/src/utils/winner.logic.ts +++ b/src/utils/winner.logic.ts @@ -30,7 +30,7 @@ export function computeRoleRemovals( const removals: { userId: string, roleId: string }[] = []; for (const { userId, roleId } of deleted) { if (remainingUserIds.has(userId)) continue; - const key = JSON.stringify([userId, roleId]); + const key = `${userId}:${roleId}`; if (seen.has(key)) continue; seen.add(key); removals.push({ userId, roleId });