Skip to content

feat: admin menu fix, onboarding gate, intro message, /announce command - #60

Merged
gamblecodezcom merged 2 commits into
mainfrom
claude/update-prod-runner-script-Lq2gS
Feb 23, 2026
Merged

feat: admin menu fix, onboarding gate, intro message, /announce command#60
gamblecodezcom merged 2 commits into
mainfrom
claude/update-prod-runner-script-Lq2gS

Conversation

@gamblecodezcom

@gamblecodezcom gamblecodezcom commented Feb 23, 2026

Copy link
Copy Markdown
Owner

User description

  • Fix: pamenu_back_user now explicitly deletes the admin menu message and clears its keyboard before rendering the user menu, so admin UI fully vanishes when tapping Back to User Menu
  • Fix: /start no longer skips onboarding — main menu is gated behind onboarding completion (getNextOnboardingStep >= 5). Returns the appropriate step prompt (account setup, username link, promo, community) instead of jumping straight to the main menu
  • Add: sexy Runewager intro message sent on /start after the greeting, auto-deletes after 15 seconds
  • Add: showOnboardingPrompt() helper routes to the correct step UI
  • Add: /A, /a, /announce commands (admin-only) with a 3-state machine: await_announcement_text → preview → await_announcement_action announce_edit → back to text input announce_send_all → broadcast to all users + @GambleCodezDrops channel announce_send_channel → channel only
  • Add: ANNOUNCE_CHANNEL constant (env ANNOUNCE_CHANNEL or @GambleCodezDrops)

https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN


CodeAnt-AI Description

Require onboarding before main menu, fully hide admin menu on return, add admin /announce and auto-deleting Runewager intro

What Changed

  • Main menu is blocked until users finish onboarding; users now see a short step label and the appropriate onboarding prompt (account setup, username link, promo, or community) instead of jumping to the main menu.
  • A Runewager intro message is shown on /start and auto-deletes after 15 seconds to give users a brief product summary before onboarding prompts.
  • Tapping "Back to User Menu" from the admin UI now fully removes the admin menu message and clears its keyboard so no admin controls remain visible to the user.
  • Added an admin-only /announce (aliases /A and /a) flow: compose announcement → preview with Edit / Send All / Send Channel options → broadcast to all users and/or post to the GambleCodezDrops channel, with reporting on success/failure.

Impact

✅ Clearer onboarding prompts
✅ Fewer lingering admin menus visible to users
✅ Easier admin broadcast announcements

💡 Usage Guide

Checking Your Pull Request

Every time you make a pull request, our system automatically looks through it. We check for security issues, mistakes in how you're setting up your infrastructure, and common code problems. We do this to make sure your changes are solid and won't cause any trouble later.

Talking to CodeAnt AI

Got a question or need a hand with something in your pull request? You can easily get in touch with CodeAnt AI right here. Just type the following in a comment on your pull request, and replace "Your question here" with whatever you want to ask:

@codeant-ai ask: Your question here

This lets you have a chat with CodeAnt AI about your pull request, making it easier to understand and improve your code.

Example

@codeant-ai ask: Can you suggest a safer alternative to storing this secret?

Preserve Org Learnings with CodeAnt

You can record team preferences so CodeAnt AI applies them in future reviews. Reply directly to the specific CodeAnt AI suggestion (in the same thread) and replace "Your feedback here" with your input:

@codeant-ai: Your feedback here

This helps CodeAnt AI learn and adapt to your team's coding style and standards.

Example

@codeant-ai: Do not flag unused imports.

Retrigger review

Ask CodeAnt AI to review the PR again, by typing:

@codeant-ai: review

Check Your Repository Health

To analyze the health of your code repository, visit our dashboard at https://app.codeant.ai. This tool helps you identify potential issues and areas for improvement in your codebase, ensuring your repository maintains high standards of code health.

Summary by CodeRabbit

  • New Features
    • Added admin announcement commands (/A, /a, /announce) to broadcast messages to users and designated channels.
    • Enhanced onboarding flow with a multi-step prompt sequence (4 steps) instead of a single prompt.
    • Introduced an auto-deleting introductory message during onboarding that disappears after 15 seconds.
    • Moved the user main menu to appear after onboarding completion.

- Fix: pamenu_back_user now explicitly deletes the admin menu message
  and clears its keyboard before rendering the user menu, so admin UI
  fully vanishes when tapping Back to User Menu
- Fix: /start no longer skips onboarding — main menu is gated behind
  onboarding completion (getNextOnboardingStep >= 5). Returns the
  appropriate step prompt (account setup, username link, promo, community)
  instead of jumping straight to the main menu
- Add: sexy Runewager intro message sent on /start after the greeting,
  auto-deletes after 15 seconds
- Add: showOnboardingPrompt() helper routes to the correct step UI
- Add: /A, /a, /announce commands (admin-only) with a 3-state machine:
    await_announcement_text → preview → await_announcement_action
    announce_edit → back to text input
    announce_send_all → broadcast to all users + @GambleCodezDrops channel
    announce_send_channel → channel only
- Add: ANNOUNCE_CHANNEL constant (env ANNOUNCE_CHANNEL or @GambleCodezDrops)

https://claude.ai/code/session_01X3PxGFF5zzKptQwVkjYzzN
@codeant-ai

codeant-ai Bot commented Feb 23, 2026

Copy link
Copy Markdown

CodeAnt AI is reviewing your PR.

@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.

@coderabbitai

coderabbitai Bot commented Feb 23, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

The changes introduce an admin announcement workflow enabling broadcast messages to users and a dedicated channel, alongside a revamped onboarding flow with sequential step-based prompts and an introductory message. New admin commands (/A, /a, /announce) surface the announcement functionality within a state-driven flow.

Changes

Cohort / File(s) Summary
Admin Announcement Workflow
index.js
Added ANNOUNCE_CHANNEL constant, handleAnnounceCommand() function, and state handlers (announce_edit, announce_send_all, announce_send_channel) to manage announcement initialization, editing, and broadcasting to users and announcement channels with admin logging.
Onboarding Flow Enhancement
index.js
Introduced showOnboardingPrompt(ctx, user, step) to present step-specific onboarding prompts (steps 1–4), replaced single-prompt flow with multi-step sequence, added introRunewager message with auto-delete, and integrated getNextOnboardingStep gating to defer main menu display until onboarding completion.
Admin Command Registration
index.js
Registered three new admin-facing commands (/A, /a, /announce) mapping to handleAnnounceCommand() to trigger the announcement workflow.

Sequence Diagram(s)

sequenceDiagram
    participant Admin as Admin User
    participant Bot as Bot
    participant State as State Manager
    participant Users as User Database
    
    Admin->>Bot: /announce command
    Bot->>State: Set state: await_announcement_text
    State-->>Bot: State updated
    Bot-->>Admin: Prompt for announcement text
    Admin->>Bot: Send announcement text
    Bot->>State: Store announcement text
    State-->>Bot: Text stored
    Bot-->>Admin: Show edit/send options
    alt Admin edits
        Admin->>Bot: announce_edit command
        Bot->>State: Set state: await_announcement_text
        Bot-->>Admin: Prompt for new text
    else Admin sends to all
        Admin->>Bot: announce_send_all
        Bot->>Users: Broadcast to non-opted-out users
        Bot->>Bot: Send to ANNOUNCE_CHANNEL
        Bot-->>Admin: Confirm broadcast (adminLog)
    else Admin sends to channel only
        Admin->>Bot: announce_send_channel
        Bot->>Bot: Send to ANNOUNCE_CHANNEL only
        Bot-->>Admin: Confirm sent (adminLog)
    end
Loading
sequenceDiagram
    participant User as User
    participant Bot as Bot
    participant State as State Manager
    participant UI as UI Renderer
    
    User->>Bot: /start command
    Bot->>State: Check age verification
    State-->>Bot: Age verified
    Bot->>UI: Display introRunewager message
    UI-->>Bot: Auto-delete after 15 seconds
    Bot->>State: Set onboarding_step = 1
    State-->>Bot: State updated
    Bot->>UI: Show onboarding prompt (step 1)
    UI-->>User: Display step-specific prompt
    loop Onboarding Steps 2–4
        User->>Bot: Respond to prompt
        Bot->>State: Increment onboarding_step
        State-->>Bot: Step updated
        Bot->>UI: Show next onboarding prompt
        UI-->>User: Display step N prompt
    end
    User->>Bot: Complete step 4
    Bot->>State: Mark onboarding_complete = true
    State-->>Bot: Onboarding complete
    Bot->>UI: Display persistent user main menu
    UI-->>User: Show main menu
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

🐇 Hops of joy through announcement flows,
Step-by-step the onboarding glows,
Admins broadcast far and wide,
While new users safely guide,
State machines dance with delight,
Making Runewager shine so bright!


Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands and usage tips.

@gamblecodezcom
gamblecodezcom merged commit b3a5565 into main Feb 23, 2026
2 checks passed
@gamblecodezcom
gamblecodezcom deleted the claude/update-prod-runner-script-Lq2gS branch February 23, 2026 00:34
@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Feb 23, 2026
Comment thread index.js
switch (step) {
case 1:
// Account setup — leads through GambleCodez VIP / Discord signup flow
await sendGambleCodezVIPStep(ctx, user);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: The new onboarding gate can be bypassed for users whose next step is "Account Setup" because showOnboardingPrompt calls sendGambleCodezVIPStep, which immediately shows the main menu when user.sawGambleCodezStep is true, so users who have seen that screen once can still reach the main menu even if other onboarding steps (verification, linking, promo, community) are incomplete. Resetting sawGambleCodezStep in the gated path ensures they see the intended step UI instead of skipping straight to the menu. [logic error]

Severity Level: Major ⚠️
- ⚠️ /start skips account-setup copy for partially-onboarded users.
- ⚠️ Onboarding step label disagrees with actual UI shown.
- ⚠️ Users may miss GambleCodez VIP signup instructions.
Suggested change
await sendGambleCodezVIPStep(ctx, user);
// In the gated onboarding flow we must not skip straight to the main menu,
// so ensure the VIP step is actually shown even if it was seen before.
user.sawGambleCodezStep = false;
Steps of Reproduction ✅
1. In `index.js:1661-1760` trigger the age gate and VIP step: send `/start`, tap "✅ I am
18+" (`age_yes` handler at `index.js:2115`), then tap "➡️ Continue — Sign Up with
GambleCodez" (`onboard_gcz_continue` at `index.js:2143`), which sets
`user.sawGambleCodezStep = true` and calls `sendPersistentUserMenu(ctx, user)`.

2. Ensure the user has not completed onboarding: `user.verified === false`,
`user.runewagerUsername` empty, `user.claimedPromo === false`, `user.hasJoinedChannel ===
false`, `user.hasJoinedGroup === false`, so `getNextOnboardingStep(user)` at
`index.js:1214-1223` still returns `1` ("Account Setup").

3. Call `/start` again; in the `/start` handler at `index.js:1765-1867`, after intro
messages it computes `nextOnboardStep = getNextOnboardingStep(user)` (value `1`), sees `<
5`, then sends the auto-deleting "Your next step: Account Setup" message and calls `await
showOnboardingPrompt(ctx, user, nextOnboardStep)` at `index.js:1852-1861`.

4. Inside `showOnboardingPrompt` (current code at `index.js:1302-1345`), case `1` calls
`sendGambleCodezVIPStep(ctx, user)`; in that helper at `index.js:2193-2211` the first line
`if (user.sawGambleCodezStep) { await sendPersistentUserMenu(ctx, user); return; }`
short-circuits, so the user is taken straight to the main menu instead of seeing the
account-setup step UI, despite `/start` detecting that onboarding is still at step 1.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** index.js
**Line:** 1306:1306
**Comment:**
	*Logic Error: The new onboarding gate can be bypassed for users whose next step is "Account Setup" because `showOnboardingPrompt` calls `sendGambleCodezVIPStep`, which immediately shows the main menu when `user.sawGambleCodezStep` is true, so users who have seen that screen once can still reach the main menu even if other onboarding steps (verification, linking, promo, community) are incomplete. Resetting `sawGambleCodezStep` in the gated path ensures they see the intended step UI instead of skipping straight to the menu.

Validate the correctness of the flagged issue. If correct, How can I resolve this? If you propose a fix, implement it and please make it concise.
👍 | 👎

@codeant-ai

codeant-ai Bot commented Feb 23, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants