Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/commands/commands/events.command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 }));
Expand Down Expand Up @@ -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" +
Expand Down
1 change: 1 addition & 0 deletions src/db/queries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/utils/winner.logic.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
Expand Down