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: 4 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ ANNOUNCE_CHANNEL="-1002648883359"
DEVICE=vps
ADMIN_IDS=YOUR_TELEGRAM_USER_ID
BOT_TOKEN=
WEBAPP_HMAC_KEY= # 32-byte secret for HMAC-signing webapp payloads/CSRF tokens; generate with: openssl rand -hex 32 (or openssl rand -base64 32); keep secret and never commit real values
# WEBAPP_HMAC_KEY: 32-byte secret for HMAC-signing webapp payloads/CSRF tokens.
# Generate with: openssl rand -hex 32 (or openssl rand -base64 32). Keep secret; never commit real values.
WEBAPP_HMAC_KEY=""
TELEGRAM_BOT_TOKEN=
DISCORD_CODE_GENERATION_IMAGE_URL=https://raw.githubusercontent.com/gamblecodezcom/Runewager/main/images/discord_code_generation.png
DISCORD_VERIFY_IMAGE_URL=https://raw.githubusercontent.com/gamblecodezcom/Runewager/main/images/discord_verify.png
Expand All @@ -14,6 +16,7 @@ MAX_ONBOARDING_STEPS_HISTORY=500
MINI_APP_CLAIM_URL=https://t.me/RuneWager_bot/claim
MINI_APP_PLAY_URL=https://t.me/RuneWager_bot/Play
MINI_APP_PROFILE_URL=https://t.me/RuneWager_bot/profile
# LOG_LEVEL valid values: debug, info, warn, error (default: info)
LOG_LEVEL=info
PORT=3000
RW_DISCORD_JOIN=https://discord.gg/runewagers
Expand Down
8 changes: 0 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@ Thumbs.db
.last_rollback
data/admin-events.log

# Runtime state files
data/analytics.json
data/dashboard.json
data/helpful_messages.json
data/promo-history.json
data/runtime-state.json
data/sshv-sessions.json

# Runtime generated data + backups
data/*.json
data/backups/**
9 changes: 9 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -148,3 +148,12 @@ You are the Runewager Bot Ops Commander. You manage the full lifecycle of the Ru
Before writing or modifying any code, the AI must always read and familiarize itself with `RUNEWAGER_FUNCTIONALITY_MAP.md`. This file is the authoritative source of truth for all bot functionality. The AI must keep this file updated with full, easy-to-understand descriptions whenever functionality is added, changed, or removed. Updating this file is a required step at the end of every coding session.

After generating or modifying any functionality, the AI must run a follow-up audit to ensure the `RUNEWAGER_FUNCTIONALITY_MAP.md` file is fully updated and accurate. No coding session is complete until the map is updated and verified.


Every coding session must end with a verification pass to detect and upgrade any missing functionality, followed by an update to RUNEWAGER_FUNCTIONALITY_MAP.md. No work is considered complete until the map is fully updated and verified.


Every coding session must begin by reading RUNEWAGER_FUNCTIONALITY_MAP.md and must end with a full 50‑point verification pass. No work is complete until the map is updated and all 50 checks pass with zero failures.


Every coding session must begin by reading RUNEWAGER_FUNCTIONALITY_MAP.md and must end with a full docstring verification pass. No work is complete until every function has a complete docstring and the map is fully updated.
18 changes: 14 additions & 4 deletions RUNEWAGER_FUNCTIONALITY_MAP.md
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ Restrictions:
## 13. Full Command Index (User + Admin)

### User-facing commands (also includes aliases)
_Note: unknown-command guard uses `REGISTERED_COMMANDS`; parity is now validated by smoke test to prevent silent command breakage._
`affiliate, bonus, bugreport, cancel, checkin, claim_history, commands, discord, discord_confirm, eligible, fixaccount, giveaway, gwhistory, health, help, join, leaderboard, leaderboard_weekly, link, linkaccount, linkrunewager, menu, mygiveaways, play, profile, promo, promocheck, referral, settings, signup, startapp, status, stuck, support, top, walkthrough`

### Admin commands
Expand Down Expand Up @@ -217,6 +218,10 @@ No universal pendingAction timeout/auto-cancel was detected for all user/admin i

## 18. Rate Limits & Cooldowns

### Verification controls
- Smoke test now enforces `REGISTERED_COMMANDS` parity with `bot.command(...)` handlers (except `start`, handled by `bot.start`).


- Promo-level cooldown and claim-limit checks in eligibility evaluation.
- Bonus request lifecycle enforces transition constraints and attempt limits.
- Smart button anti-duplicate TTL reduces repeated callback abuse.
Expand Down Expand Up @@ -263,7 +268,7 @@ Key shared helper families in `index.js`:
## 23. Feature‑Level Flowcharts

### Promo claim flow
```
```text
/promo or menu_claim_bonus
-> load active promos
-> evaluate eligibility per promo
Expand All @@ -276,7 +281,7 @@ Key shared helper families in `index.js`:
```

### Announcement flow
```
```text
admin_cmd_announce_start or /announce
-> await_announcement_text
-> preview + toggles (DM/Channel/Group + parse mode)
Expand All @@ -286,7 +291,7 @@ admin_cmd_announce_start or /announce
```

### Content drop target registration
```
```text
Admin forwards message from channel/group
-> autoRegisterForwardedChatIfPresent
-> approvedGroupsStore add(chatId)
Expand All @@ -295,7 +300,7 @@ Admin forwards message from channel/group
```

### Giveaway start/join
```
```text
Admin starts wizard (gwiz)
-> collect config steps
-> createGiveaway + announceGiveaway
Expand All @@ -310,6 +315,11 @@ Admin starts wizard (gwiz)
- 2026-02-26: Created initial comprehensive functionality map and synchronized with current menu/state architecture.
- 2026-02-26: Added explicit note that template-literal callback IDs are excluded from literal smoke checks.
- 2026-02-26: Documented Tests & Bugs admin category, promo step guide, and forwarded-chat auto-registration behavior.
- 2026-02-26: Added command-registry verification notes and synchronized missing admin commands (`/pmapprove`, `/pmdeny`, `/register_chat`, `/verify_bot_setup`).

- 2026-02-26: Completed a 50-point verification pass, synchronized command registry coverage, and extended smoke checks for command-registration parity.

- 2026-02-26: Added repo-wide baseline docstrings to named function declarations (runtime, helper, and test modules) and re-verified command/callback coverage.

## 25. AI Coder Contract Requirements

Expand Down
Loading
Loading