Skip to content

Claude/runewager telegram bot ju ygf - #5

Merged
gamblecodezcom merged 3 commits into
mainfrom
claude/runewager-telegram-bot-JUYgf
Feb 20, 2026
Merged

Claude/runewager telegram bot ju ygf#5
gamblecodezcom merged 3 commits into
mainfrom
claude/runewager-telegram-bot-JUYgf

Conversation

@gamblecodezcom

@gamblecodezcom gamblecodezcom commented Feb 20, 2026

Copy link
Copy Markdown
Owner

User description

Summary by CodeRabbit

  • New Features
    • Added /status command to view consolidated account status including age confirmation, Discord verification, linked Runewager account, promo claims, and channel/group memberships
    • Added /linkaccount command for streamlined account linking workflow
    • Enhanced verification flow with improved step-by-step guidance and optional visual aids
    • Expanded help documentation with comprehensive command references and updated support links
    • Improved messaging with richer formatting and clearer user prompts throughout the bot experience

CodeAnt-AI Description

Switch to Node.js Telegraf bot; add /linkaccount and /status; show local images in walkthrough and verification

What Changed

  • Bot implementation replaced with a Node.js/Telegraf version (users interact the same but commands/responses are updated)
  • New /linkaccount command (with /linkrunewager as an alias) that prompts users to submit their Runewager username and shows current linked name when present
  • New /status command that shows a consolidated account summary: age confirmation, Discord verification, Runewager username, promo claim status, channel/group membership, 30 SC bonus status, and link preference
  • Help and admin help messages rewritten for clearer, step-by-step command guidance and explicit admin controls
  • Verification and promo flows now include local images when available (profile code generation, Discord paste, promo entry) and show direct browser links including a Discord support ticket link for troubleshooting
  • Walkthrough steps updated to reference profile and affiliate URLs, include support guidance, and use local images where present; prompts now reference /linkaccount
  • Deployment/start instructions updated to run the Node bot (start script and Dockerfile now launch node index.js)

Impact

✅ Clearer verification steps with images and support links
✅ Shorter account linking with explicit link status
✅ Clearer promo entry instructions to reduce user confusion

💡 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.

- Remove runewager_bot.py, requirements.txt, runtime.txt, fly.toml, .tool-versions
- Add index.js: full Telegraf bot with onboarding, promo, giveaway, admin panel
- Add package.json, package-lock.json with telegraf + dotenv dependencies
- Update Dockerfile to Node 20-slim
- Update start.sh to run node index.js
- Add .env.example and .gitignore

https://claude.ai/code/session_014jMGWcmUu4zw64qVhSfV6a
…l links

- Wire local images/ PNGs into walkthrough and onboarding flows
  (discord_code_generation.png, discord_verify.png, promo_entry.png)
- Add /linkaccount as primary command (README spec); keep /linkrunewager alias
- Add /status command: shows age, verified, username, promo, channel/group, bonus
- Add LINKS.runewagerProfile (runewager.com/profile) and LINKS.discordSupportTicket
- menu_verify_account: send both images with correct captions + support ticket button
- menu_claim_bonus: send promo_entry.png before instructions
- Walkthrough step 4: include Discord support ticket link on error
- Walkthrough step 5/6: dynamic promo code and amount in body
- Walkthrough step 9: reference /linkaccount
- /help: full command list matching README
- /admin_help: detailed admin guide covering promo, giveaway, 30 SC bonus
- sendWalkthroughStep: handle local file paths via replyWithPhoto({source})
- .env.example: document all links from README
- .gitignore: exclude bot_state.json

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

codeant-ai Bot commented Feb 20, 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 20, 2026

Copy link
Copy Markdown

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This pull request migrates the Telegram bot from Python to Node.js. The changes involve replacing the Python runtime with Node.js in Docker and startup configurations, removing Python tooling files, and reimplementing bot functionality in JavaScript with expanded command handlers and UI features.

Changes

Cohort / File(s) Summary
Environment Configuration
.env.example, .gitignore, package.json
Added environment template with BOT_TOKEN and optional URL overrides; added gitignore patterns for node_modules, .env, and logs; introduced package.json with dependencies (dotenv, telegraf) and start script.
Runtime & Docker Setup
Dockerfile, start.sh, runtime.txt, .tool-versions, requirements.txt
Transitioned base image from python:3.10-slim to node:20-slim; replaced pip with npm ci for dependency installation; updated CMD to execute node instead of python; removed Python runtime and tool version specifications; deleted Python package requirements.
Bot Implementation
index.js, runewager_bot.py
Implemented new Node.js bot using telegraf library with expanded LINKS object (added runewagerProfile, discordSupportTicket), local image path handling, new commands (linkaccount, status), enriched help/admin messaging, and enhanced verification workflows; replaced legacy Python implementation entirely.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 From Python's den to Node's green glade,
A migration bold, a switch well-made,
Docker dancing with npm's grace,
Telegraf commands finding their place,
Bot hops faster in JavaScript's space!

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch claude/runewager-telegram-bot-JUYgf

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@gamblecodezcom
gamblecodezcom merged commit f2ee637 into main Feb 20, 2026
1 check was pending
@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Feb 20, 2026
@codeant-ai

codeant-ai Bot commented Feb 20, 2026

Copy link
Copy Markdown

Nitpicks 🔍

🔒 No security issues identified
⚡ Recommended areas for review

  • Unescaped Markdown content
    Several replies use parse_mode 'Markdown' and directly interpolate user-controlled values (usernames, Runewager usernames, promo codes). Unescaped input can break message formatting or be used to craft misleading messages. Ensure dynamic content is escaped or use a safer parse mode and sanitize where necessary.

  • Install failure risk
    The Dockerfile runs npm ci --omit=dev after copying package*.json. npm ci requires a lockfile (package-lock.json or npm-shrinkwrap). If a lockfile is not present in the build context, npm ci will fail and the image build will break. Verify the repository includes a lockfile, or make the install step tolerant when a lockfile is missing.

  • Missing build / dependency assumptions
    The install uses --omit=dev, which will skip devDependencies. If the project requires devDependencies for build-time steps (e.g., TypeScript compiler, bundlers, or postinstall build scripts), the runtime may fail. Confirm build artifacts are committed or include an explicit multi-stage build that performs the build with devDependencies and copies only the artifacts to the final image.

  • Runtime assumption
    The new start command assumes Node.js is installed and available on PATH. Verify target hosts/containers/CI images include the expected Node version and that dependencies (node_modules or build artifacts) exist before switching from the previous Python entrypoint.

  • Deployment mismatch risk
    Replacing a Python entrypoint with a Node entrypoint is a behavioral change. Ensure related deployment artifacts (Dockerfile, systemd service, CI scripts, docs) are updated to reflect the platform change and that any required environment variables or build steps are present.

Comment thread index.js
Comment on lines +476 to +479
+ '/admin_help — Admin usage guide\n'
+ '/start_giveaway — Launch an SC giveaway\n'
+ '/wager30_admin — 30 SC bonus admin panel\n\n'
+ '*Support:*\n'

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 help message uses Telegram's Markdown parse mode but includes command names with unescaped underscores, which causes Telegram to reject the message with a "can't parse entities" error so users never see the help text. [possible bug]

Severity Level: Critical 🚨
- ❌ /help command fails; help text never delivered.
- ⚠️ Users lack in-bot command documentation and guidance.
Suggested change
+ '/admin_help — Admin usage guide\n'
+ '/start_giveaway — Launch an SC giveaway\n'
+ '/wager30_admin — 30 SC bonus admin panel\n\n'
+ '*Support:*\n'
+ '/admin\\_help — Admin usage guide\n'
+ '/start\\_giveaway — Launch an SC giveaway\n'
+ '/wager30\\_admin — 30 SC bonus admin panel\n\n'
Steps of Reproduction ✅
1. Start the bot with a valid BOT_TOKEN so it reaches the command registration code in
`/workspace/Runewager/index.js`.

2. In Telegram, send the `/help` command to the bot, which is wired to
`bot.command('help', ...)` at `index.js:461-491`.

3. The handler at `index.js:463` calls `ctx.reply(...)` with `parse_mode: 'Markdown'` and
a help string containing `/admin_help`, `/start_giveaway`, and `/wager30_admin` (see
`index.js:467-478`), all of which include unescaped `_` characters.

4. Telegram's Markdown parser rejects the message with a "can't parse entities" error due
to the unescaped underscores, so Telegraf's `ctx.reply` call fails and the user never
receives the help text.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** index.js
**Line:** 476:479
**Comment:**
	*Possible Bug: The help message uses Telegram's Markdown parse mode but includes command names with unescaped underscores, which causes Telegram to reject the message with a "can't parse entities" error so users never see the help text.

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.
👍 | 👎

Comment thread index.js
Comment on lines +560 to +575
+ '*Giveaway Management (/start_giveaway):*\n'
+ '• Set winners, SC per winner, duration\n'
+ '• Toggle: require channel, group, username, age, verified, promo, walkthrough\n'
+ '• Restrict by referral tag\n'
+ '• Test mode (1 min) and dry-run (no public announce)\n'
+ '• Reroll, mark paid, extend, edit winners/SC, cancel, export\n'
+ '• Countdown reminders at 10m, 5m, 1m\n\n'
+ '*30 SC Bonus (/wager30_admin):*\n'
+ '• View pending requests\n'
+ '• Approve / Deny with optional denial reason\n'
+ '• Lookup user by Telegram ID or Runewager username\n'
+ '• Manual override — mark as already credited\n'
+ '• Reset user status to allow new request\n'
+ '• View bonus statistics\n\n'
+ '*Tips:*\n'
+ '• State is auto-saved to bot_state.json every 5s\n'

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 admin help message is sent with Markdown parse mode but contains unescaped underscores in command names and file names, which will cause Telegram's Markdown parser to error and prevent the message from being delivered. [possible bug]

Severity Level: Major ⚠️
- ❌ /admin_help fails; admins lose reference documentation.
- ⚠️ Admins may misconfigure giveaways or promos without guidance.
Suggested change
+ '*Giveaway Management (/start_giveaway):*\n'
+ '• Set winners, SC per winner, duration\n'
+ '• Toggle: require channel, group, username, age, verified, promo, walkthrough\n'
+ '• Restrict by referral tag\n'
+ '• Test mode (1 min) and dry-run (no public announce)\n'
+ '• Reroll, mark paid, extend, edit winners/SC, cancel, export\n'
+ '• Countdown reminders at 10m, 5m, 1m\n\n'
+ '*30 SC Bonus (/wager30_admin):*\n'
+ '• View pending requests\n'
+ '• Approve / Deny with optional denial reason\n'
+ '• Lookup user by Telegram ID or Runewager username\n'
+ '• Manual override — mark as already credited\n'
+ '• Reset user status to allow new request\n'
+ '• View bonus statistics\n\n'
+ '*Tips:*\n'
+ '• State is auto-saved to bot_state.json every 5s\n'
+ '*Giveaway Management (/start\\_giveaway):*\n'
+ '• Set winners, SC per winner, duration\n'
+ '• Toggle: require channel, group, username, age, verified, promo, walkthrough\n'
+ '• Restrict by referral tag\n'
+ '• Test mode (1 min) and dry-run (no public announce)\n'
+ '• Reroll, mark paid, extend, edit winners/SC, cancel, export\n'
+ '• Countdown reminders at 10m, 5m, 1m\n\n'
+ '*30 SC Bonus (/wager30\\_admin):*\n'
+ '• View pending requests\n'
+ '• Approve / Deny with optional denial reason\n'
+ '• Lookup user by Telegram ID or Runewager username\n'
+ '• Manual override — mark as already credited\n'
+ '• Reset user status to allow new request\n'
+ '• View bonus statistics\n\n'
+ '*Tips:*\n'
+ '• State is auto-saved to bot\\_state.json every 5s\n'
Steps of Reproduction ✅
1. Run the bot with a valid BOT_TOKEN and an ADMIN_IDS list so at least one Telegram
account passes `requireAdmin` in `/workspace/Runewager/index.js`.

2. From an admin Telegram account, send `/admin_help` to the bot, which routes to
`bot.command('admin_help', ...)` at `index.js:548-580`.

3. The handler at `index.js:550` calls `ctx.reply(...)` with `parse_mode: 'Markdown'` and
text that includes `/start_giveaway`, `/wager30_admin`, and `bot_state.json` containing
unescaped `_` characters (see `index.js:560-575`).

4. Telegram's Markdown parser rejects the message because the underscores start unmatched
italic entities, causing a "can't parse entities" error and preventing the admin help
message from being delivered.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** index.js
**Line:** 560:575
**Comment:**
	*Possible Bug: The admin help message is sent with Markdown parse mode but contains unescaped underscores in command names and file names, which will cause Telegram's Markdown parser to error and prevent the message from being delivered.

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.
👍 | 👎

Comment thread start.sh
@@ -1,2 +1,2 @@
#!/bin/bash
python3 runewager_bot.py
node index.js

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 script invokes node index.js assuming the current working directory is the repository root; if start.sh is run from another directory, Node will fail to locate index.js (and the .env file), causing the bot to crash at startup. [logic error]

Severity Level: Major ⚠️
- ❌ Bot fails to start when script run via absolute path.
- ⚠️ Operators launching start.sh outside repo root see confusing failure.
Suggested change
node index.js
cd "$(dirname "$0")"
Steps of Reproduction ✅
1. Confirm repository layout: `index.js` and `start.sh` both exist in
`/workspace/Runewager` (verified via LS of `/workspace/Runewager` and Read of
`/workspace/Runewager/start.sh`, which shows `node index.js` on line 2).

2. From a different directory, e.g. `/` or any other path, execute the script using its
full path: `bash /workspace/Runewager/start.sh` (note that the current working directory
remains `/` while the script runs).

3. During execution, line 2 of `start.sh` (`node index.js`) runs with the current working
directory still set to `/` (or whichever non-repo directory you started in), as there is
no `cd` in the script.

4. Node attempts to load `index.js` from the current working directory (e.g. `/index.js`),
but that file does not exist; `index.js` is in `/workspace/Runewager`, so Node exits with
a "Cannot find module" or similar startup error and the Telegram bot never starts.
Prompt for AI Agent 🤖
This is a comment left during a code review.

**Path:** start.sh
**Line:** 2:2
**Comment:**
	*Logic Error: The script invokes `node index.js` assuming the current working directory is the repository root; if `start.sh` is run from another directory, Node will fail to locate `index.js` (and the `.env` file), causing the bot to crash at startup.

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 20, 2026

Copy link
Copy Markdown

CodeAnt AI finished reviewing your PR.

gamblecodezcom pushed a commit that referenced this pull request Feb 20, 2026
- Escape underscores in /help Markdown text so Telegram parses
  /admin\_help, /start\_giveaway, /wager30\_admin correctly (lines 476-479)
- Escape underscores in /admin_help Markdown text including
  /start\_giveaway, /wager30\_admin, and bot\_state.json (lines 560-575)
- Add cd "$(dirname "$0")" to start.sh so the bot can be launched
  from any directory without failing to locate index.js or .env

https://claude.ai/code/session_015dK7HhazhmBNkK2Z9nYHzF
@gamblecodezcom
gamblecodezcom deleted the claude/runewager-telegram-bot-JUYgf branch February 20, 2026 05:02
gamblecodezcom added a commit that referenced this pull request Feb 20, 2026
…ot-JUYgf

Claude/runewager telegram bot ju ygf
gamblecodezcom pushed a commit that referenced this pull request Feb 20, 2026
- Escape underscores in /help Markdown text so Telegram parses
  /admin\_help, /start\_giveaway, /wager30\_admin correctly (lines 476-479)
- Escape underscores in /admin_help Markdown text including
  /start\_giveaway, /wager30\_admin, and bot\_state.json (lines 560-575)
- Add cd "$(dirname "$0")" to start.sh so the bot can be launched
  from any directory without failing to locate index.js or .env

https://claude.ai/code/session_015dK7HhazhmBNkK2Z9nYHzF
gamblecodezcom added a commit that referenced this pull request Feb 20, 2026
…ezcom/claude/runewager-telegram-bot-JUYgf
gamblecodezcom added a commit that referenced this pull request Feb 20, 2026
gamblecodezcom added a commit that referenced this pull request Feb 20, 2026
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