Last audited: 2026-03-15 (restored map file after missing-file boot failure).
Source of truth files: index.js, test/*.test.js, scripts under scripts/, and runtime docs in repo root.
Runewager is a Telegraf-based Telegram bot that provides onboarding, promos, giveaways, tooltips, and admin operations. The bot is primarily configured via inline menus and commands, with persistent user/admin menus and stateful flows stored in memory with periodic persistence to data/.
Core runtime lives in index.js.
State is stored in memory and persisted under data/.
Routing uses bot.command(...), bot.action(...), and bot.on('text') handlers.
Utility subsystems include eligibility checks, validation helpers, markdown escaping, analytics/event logging, and admin audit logging.
Unknown commands route to a structured help/error response.
Critical actions are guarded by requireAdmin for admin-only flows.
Health and runtime telemetry are exposed via the /health endpoint and runtime logs.
- Age gate, welcome flow, and account linking guidance.
- Initial menu and onboarding help.
- Bonus request intake flow and status feedback.
- Validation and eligibility checks.
- Promo manager store and eligibility checks.
- Claim lifecycle and admin tools.
- Giveaway creation, join, eligibility validation, and finalization.
- Admin control panel and reroll tools.
- Referral tracking and attribution handling.
- Basic referral status feedback.
- Admin-only commands and audit logging.
- Diagnostics and maintenance workflows.
- Group link verification and admin controls.
- Chat linking and validation flows.
- Play mode selection and mode-specific guidance.
- Persisted preference per user.
- Persistent menus with quick actions.
- Tooltip delivery and scheduling.
- User profile view and XP tracking.
- Level/XP summaries in UI.
- Help commands and contextual guidance.
- Fallback responses for invalid flows.
- Admin broadcast tools and safety checks.
- Segment targeting support.
/healthendpoint and runtime logs.- Admin diagnostics and operational checks.
- Automated runtime tests and debug helpers.
- AST-driven test coverage checks.
- Replay and mirror tooling for diagnostics.
- FixIt helpers and guided remediations.
- Marketing and value prop panel.
- Inline navigation back to main menus.
- Control panel shortcuts for core actions.
- Admin-only control paths.
- Daily check-in flow and streak tracking.
- XP and giveaway weight boosts.
- File-based tooltips with inline button formats.
- Daily promo cache and affiliate URL routing.
- Expanded control panel actions.
- Tooltips and notifications shortcuts.
- Per-user notification toggles.
- Notifications preference storage.
- Discord URL guidance and support links.
- Ticket flow routing.
- User ticket storage and admin responses.
- Admin ticket panel tooling.
- Save, load, delete favorites.
- Preview controls.
/bugalias and reward claim shortcut./supportchatdirect ticket flow.
- Centralized admin gating for command/action handlers.
- Internal helpers retain inline admin checks.
- Boost status, streak info, and multiplier display.
- Share link and navigation controls.
- Admin wizard flow and auto-generation helpers.
- Preview and post-launch control panel.