Skip to content

Latest commit

 

History

History
132 lines (99 loc) · 4.48 KB

File metadata and controls

132 lines (99 loc) · 4.48 KB

RUNEWAGER_FUNCTIONALITY_MAP.md

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.


1. High-Level Overview

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

2. System Architecture Summary

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.

3. Global Bot Behaviors

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.

Feature 1 — Onboarding & User Registration

  • Age gate, welcome flow, and account linking guidance.
  • Initial menu and onboarding help.

Feature 2 — Bonus / Wager Bonus Request Flow

  • Bonus request intake flow and status feedback.
  • Validation and eligibility checks.

Feature 3 — Promo Codes

  • Promo manager store and eligibility checks.
  • Claim lifecycle and admin tools.

Feature 4 — Giveaway System (Admin + User)

  • Giveaway creation, join, eligibility validation, and finalization.
  • Admin control panel and reroll tools.

Feature 5 — Referral System

  • Referral tracking and attribution handling.
  • Basic referral status feedback.

Feature 6 — Admin Panel & Commands

  • Admin-only commands and audit logging.
  • Diagnostics and maintenance workflows.

Feature 7 — Group Management & Linking

  • Group link verification and admin controls.
  • Chat linking and validation flows.

Feature 8 — Play Modes (Browser / Mini-App)

  • Play mode selection and mode-specific guidance.
  • Persisted preference per user.

Feature 9 — Persistent Menu & Tooltips

  • Persistent menus with quick actions.
  • Tooltip delivery and scheduling.

Feature 10 — Profile & XP

  • User profile view and XP tracking.
  • Level/XP summaries in UI.

Feature 11 — Help System

  • Help commands and contextual guidance.
  • Fallback responses for invalid flows.

Feature 12 — Broadcast & Mass-Messaging

  • Admin broadcast tools and safety checks.
  • Segment targeting support.

Feature 13 — Health, Metrics & Monitoring

  • /health endpoint and runtime logs.
  • Admin diagnostics and operational checks.

Feature 14 — TestAll & Debug Pipeline

  • Automated runtime tests and debug helpers.
  • AST-driven test coverage checks.

Feature 15 — AI Mirror / Replay / FixIt Modules

  • Replay and mirror tooling for diagnostics.
  • FixIt helpers and guided remediations.

Feature 16 — Why Runewager Panel

  • Marketing and value prop panel.
  • Inline navigation back to main menus.

Feature 17 — Control Panel Submenu

  • Control panel shortcuts for core actions.
  • Admin-only control paths.

Feature 18 — Daily Check-In System (19:00 CST reset, streak, XP, giveaway weight)

  • Daily check-in flow and streak tracking.
  • XP and giveaway weight boosts.

Feature 19 — Tooltip System v2

  • File-based tooltips with inline button formats.
  • Daily promo cache and affiliate URL routing.

Feature 20 — Control Panel v2

  • Expanded control panel actions.
  • Tooltips and notifications shortcuts.

Feature 21 — Bot Notifications Submenu

  • Per-user notification toggles.
  • Notifications preference storage.

Feature 22 — Support Submenu

  • Discord URL guidance and support links.
  • Ticket flow routing.

Feature 23 — User Support Tickets

  • User ticket storage and admin responses.
  • Admin ticket panel tooling.

Feature 24 — Announcement Favorites

  • Save, load, delete favorites.
  • Preview controls.

Feature 25 — Deep-Link Commands

  • /bug alias and reward claim shortcut.
  • /supportchat direct ticket flow.

Feature 26 — requireAdmin Centralization

  • Centralized admin gating for command/action handlers.
  • Internal helpers retain inline admin checks.

Feature 27 — Boost Meter

  • Boost status, streak info, and multiplier display.
  • Share link and navigation controls.

Feature 28 — Giveaway Wizard v2

  • Admin wizard flow and auto-generation helpers.
  • Preview and post-launch control panel.