From c485d9b8bfcfa4f10a41d68b070e676471a0e98f Mon Sep 17 00:00:00 2001 From: Nick Clark Date: Sat, 18 Apr 2026 18:27:27 -0400 Subject: [PATCH] Reapply OmegaBot changes for PR branch --- docs/commands.md | 44 +++++++++---------- docs/recommendations.md | 8 ++-- .../subcommands/games-b/tictactoe/vsBot.ts | 10 ++++- .../subcommands/games-b/tictactoe/vsPlayer.ts | 5 ++- src/commands/games/giveaway/handlers.ts | 5 ++- src/commands/other/playback/playback.ts | 10 ++++- .../social/quote-message/quote-message.ts | 5 ++- src/commands/social/summary/summary.ts | 5 ++- src/services/games/randomEvents.test.ts | 8 +++- 9 files changed, 65 insertions(+), 35 deletions(-) diff --git a/docs/commands.md b/docs/commands.md index c5f79173..39fe9b44 100644 --- a/docs/commands.md +++ b/docs/commands.md @@ -12,29 +12,29 @@ The main hub for all games and fun features. ### Games -| Command | Description | -| ------------------------- | ------------------------------------------------------------------------------------------------------- | -| `/fun 8ball` | Ask the magic 8-ball | -| `/fun rps` | Rock paper scissors (solo or PvP) | -| `/fun tictactoe` | Tic Tac Toe (solo or PvP; opponent is DMed when it's their turn) | -| `/fun trivia` | Trivia with points and streaks | -| `/fun blackjack` | Interactive blackjack | -| `/fun connect4` | PvP Connect 4 (persistent multi-day; use **continue** to resume; opponent is DMed when it's their turn) | -| `/fun hangman play` | Hangman (dropdown letters, difficulty) | -| `/fun hangman stats` | Hangman stats (wins, fastest time) | -| `/fun hangman words add` | (Admin) Add word to list | -| `/fun hangman words list` | (Admin) List words | -| `/fun wordle` | Daily word puzzle | +| Command | Description | +| ------------------------- | ------------------------------------------------------------------------------------------------------------- | +| `/fun 8ball` | Ask the magic 8-ball | +| `/fun rps` | Rock paper scissors (solo or PvP) | +| `/fun tictactoe` | Tic Tac Toe (solo or PvP; opponent is DMed when it's their turn) | +| `/fun trivia` | Trivia with points and streaks | +| `/fun blackjack` | Interactive blackjack | +| `/fun connect4` | PvP Connect 4 (persistent multi-day; use **continue** to resume; opponent is DMed when it's their turn) | +| `/fun hangman play` | Hangman (dropdown letters, difficulty) | +| `/fun hangman stats` | Hangman stats (wins, fastest time) | +| `/fun hangman words add` | (Admin) Add word to list | +| `/fun hangman words list` | (Admin) List words | +| `/fun wordle` | Daily word puzzle | | `/fun slots` | Slot machine (1, 3, or 5 rows) with jackpots; rare random events (Lucky Spin, Double XP, etc.) show in result | -| `/fun darts` | Throw 3 darts (solo or PvP), stats, leaderboards (best/180/PvP) | -| `/fun chess` | Challenge someone to chess or get Lichess links (vs computer) | -| `/fun memory` | Match pairs of cards (memory game) | -| `/fun higherlower` | Think of a number 1–100; bot guesses with Higher/Lower | -| `/fun would-you-rather` | WYR questions | -| `/fun coinflip` | Heads or tails | -| `/fun choose` | Pick one or more options at random (e.g. pizza, pasta, salad) | -| `/fun dice` | Roll dice (notation: 2d6+3, or sides/count) | -| `/fun utility poll` | Create polls | +| `/fun darts` | Throw 3 darts (solo or PvP), stats, leaderboards (best/180/PvP) | +| `/fun chess` | Challenge someone to chess or get Lichess links (vs computer) | +| `/fun memory` | Match pairs of cards (memory game) | +| `/fun higherlower` | Think of a number 1–100; bot guesses with Higher/Lower | +| `/fun would-you-rather` | WYR questions | +| `/fun coinflip` | Heads or tails | +| `/fun choose` | Pick one or more options at random (e.g. pizza, pasta, salad) | +| `/fun dice` | Roll dice (notation: 2d6+3, or sides/count) | +| `/fun utility poll` | Create polls | **Rate limits** (per user, to prevent spam): diff --git a/docs/recommendations.md b/docs/recommendations.md index 664fc1a8..d4f2b3de 100644 --- a/docs/recommendations.md +++ b/docs/recommendations.md @@ -16,11 +16,11 @@ Suggestions for new slash commands and other improvements. Prioritized by impact ### Medium value -| Command | Description | Why | -| ----------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | -| **`/fun choose`** | Pick one (or N) from a list: “A, B, C” or “option1 / option2”. | Quick “bot pick for us” without a full poll; good for games or decisions. | +| Command | Description | Why | +| ----------------------------------------------- | -------------------------------------------------------------- | --------------------------------------------------------------------------------------------------- | +| **`/fun choose`** | Pick one (or N) from a list: “A, B, C” or “option1 / option2”. | Quick “bot pick for us” without a full poll; good for games or decisions. | | **`/fun utility remind_list`** (already exists) | — | Consider surfacing in `/help` or a “Your reminders” line in `/profile view` so it’s discoverable. | -| **`/config moderator-role`** | Add/remove a role that can use `/admin` moderation. | You have DB-backed moderator roles; if not exposed yet, a subcommand here would complete the story. | +| **`/config moderator-role`** | Add/remove a role that can use `/admin` moderation. | You have DB-backed moderator roles; if not exposed yet, a subcommand here would complete the story. | ### Lower priority / niche diff --git a/src/commands/games/fun/subcommands/games-b/tictactoe/vsBot.ts b/src/commands/games/fun/subcommands/games-b/tictactoe/vsBot.ts index c226f8dc..6618f4b8 100644 --- a/src/commands/games/fun/subcommands/games-b/tictactoe/vsBot.ts +++ b/src/commands/games/fun/subcommands/games-b/tictactoe/vsBot.ts @@ -158,14 +158,20 @@ export async function playVsBot(interaction: ChatInputCommandInteraction): Promi if (isKnownInteractionError(err)) { logKnownInteractionError(err, "tictactoe.vsBot.collect", { gameId }); } else { - getContextLogger().warn({ err, gameId }, "[tictactoe] vsBot button collect threw"); + getContextLogger().warn( + { err, gameId }, + "[tictactoe] vsBot button collect threw", + ); } } }); collector.on("end", async (_, reason) => { if (reason === "time") { - getContextLogger().warn({ gameId, userId: interaction.user.id }, "[tictactoe] vsBot timed out"); + getContextLogger().warn( + { gameId, userId: interaction.user.id }, + "[tictactoe] vsBot timed out", + ); await safeMessageEdit( message, { diff --git a/src/commands/games/fun/subcommands/games-b/tictactoe/vsPlayer.ts b/src/commands/games/fun/subcommands/games-b/tictactoe/vsPlayer.ts index 946014e7..b5b8c547 100644 --- a/src/commands/games/fun/subcommands/games-b/tictactoe/vsPlayer.ts +++ b/src/commands/games/fun/subcommands/games-b/tictactoe/vsPlayer.ts @@ -273,7 +273,10 @@ export async function playVsPlayer( if (isKnownInteractionError(err)) { logKnownInteractionError(err, "tictactoe.vsPlayer.collect", { gameId }); } else { - getContextLogger().warn({ err, gameId }, "[tictactoe] vsPlayer button collect threw"); + getContextLogger().warn( + { err, gameId }, + "[tictactoe] vsPlayer button collect threw", + ); } } }); diff --git a/src/commands/games/giveaway/handlers.ts b/src/commands/games/giveaway/handlers.ts index 8e8e68dc..a5a6b065 100644 --- a/src/commands/games/giveaway/handlers.ts +++ b/src/commands/games/giveaway/handlers.ts @@ -208,7 +208,10 @@ export async function autoEndGiveaway( }); } } catch (err) { - getContextLogger().warn({ err, giveawayId }, "[giveaway] update message on auto-end threw"); + getContextLogger().warn( + { err, giveawayId }, + "[giveaway] update message on auto-end threw", + ); } if (winners.length > 0) { diff --git a/src/commands/other/playback/playback.ts b/src/commands/other/playback/playback.ts index f108e9d3..beaf1209 100644 --- a/src/commands/other/playback/playback.ts +++ b/src/commands/other/playback/playback.ts @@ -167,7 +167,10 @@ export async function execute(interaction: ChatInputCommandInteraction): Promise await safeEditReply(interaction, { components: [] }, "playback.end"); } catch (err) { // ignore - getContextLogger().debug({ err }, "[playback] cleanup after collector end failed"); + getContextLogger().debug( + { err }, + "[playback] cleanup after collector end failed", + ); } }); } catch (err) { @@ -188,7 +191,10 @@ export async function execute(interaction: ChatInputCommandInteraction): Promise }); } } catch (replyErr) { - getContextLogger().error({ err: replyErr }, "[playback] send fallback error reply threw"); + getContextLogger().error( + { err: replyErr }, + "[playback] send fallback error reply threw", + ); } } } diff --git a/src/commands/social/quote-message/quote-message.ts b/src/commands/social/quote-message/quote-message.ts index 7402eee1..dd4a921e 100644 --- a/src/commands/social/quote-message/quote-message.ts +++ b/src/commands/social/quote-message/quote-message.ts @@ -75,7 +75,10 @@ export async function execute( embeds: [embed], }); } catch (err) { - getContextLogger().error({ err, command: "quote-message" }, "[quote-message] save quote threw"); + getContextLogger().error( + { err, command: "quote-message" }, + "[quote-message] save quote threw", + ); await interaction.editReply("The quote couldn't be saved. Try again in a moment."); } } diff --git a/src/commands/social/summary/summary.ts b/src/commands/social/summary/summary.ts index 2a01d795..057a7a34 100644 --- a/src/commands/social/summary/summary.ts +++ b/src/commands/social/summary/summary.ts @@ -98,7 +98,10 @@ export async function execute(interaction: ChatInputCommandInteraction): Promise ); } } catch (err) { - getContextLogger().error({ err, command: "summary" }, "[summary] summary command threw"); + getContextLogger().error( + { err, command: "summary" }, + "[summary] summary command threw", + ); if (interaction.deferred || interaction.replied) { await interaction.editReply( diff --git a/src/services/games/randomEvents.test.ts b/src/services/games/randomEvents.test.ts index a7dce981..a0b46163 100644 --- a/src/services/games/randomEvents.test.ts +++ b/src/services/games/randomEvents.test.ts @@ -30,7 +30,13 @@ describe("randomEvents", () => { for (let i = 0; i < 50; i++) { const result = rollRandomEvent({ triggerChance: 1, - weights: { lucky_spin: 1, double_xp: 1, bonus_coins: 1, jackpot_boost: 1, none: 0 }, + weights: { + lucky_spin: 1, + double_xp: 1, + bonus_coins: 1, + jackpot_boost: 1, + none: 0, + }, }); kinds.push(result.kind); if (result.kind !== "none") {