# kazzyapi/steam-report-bot architecture

> Architecture diagram of the GitHub repository kazzyapi/steam-report-bot, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-30). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/kazzyapi/steam-report-bot
- Repository: https://github.com/kazzyapi/steam-report-bot

## Overview

Steam Report Bot is a Discord command bot for Steam-profile reporting, account balances and keys, watchlists, whitelists, and ban notifications. Users issue prefixed commands; the message handlers dispatch commands, which use MongoDB-backed records and, for reports, Steam accounts and proxies. A scheduled app process checks watched profiles for community bans and updates Discord notifications and counters. The excerpts show the report and watchlist paths in detail; other command capabilities are represented from the source index and README, so their internal connections are omitted where implementation evidence is unavailable.

Main entry points: [`app.js`](https://github.com/kazzyapi/steam-report-bot/blob/main/app.js) (Bot bootstrap), [`Commands/General/report.js`](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/report.js) (Report workflow), [`Commands/General/redeem.js`](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/redeem.js) (Redeem key), [`events/guild/message.js`](https://github.com/kazzyapi/steam-report-bot/blob/main/events/guild/message.js) (Message dispatch)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_app["Bot bootstrap<br/>[app.js]"]
  node_message_events["Message dispatch<br/>[message.js]"]
  node_dm_events["DM dispatch<br/>[dm.js]"]
end

subgraph group_commands["User commands"]
  node_general_commands["General commands"]
  node_key_commands["Key management<br/>[genkey.js]"]
  node_redeem_command["Redeem key<br/>[redeem.js]"]
  node_balance_command["Balance lookup<br/>[balance.js]"]
  node_whitelist_command["Whitelist control<br/>[whitelist.js]"]
end

subgraph group_records["MongoDB records"]
  node_ban_check[("Watched profiles<br/>[banCheckSchema.js]")]
  node_user_records[("User balances<br/>[userSchema.js]")]
  node_key_records[("Redeemable keys<br/>[keySchema.js]")]
  node_whitelist_records[("Whitelist entries<br/>[whitelistSchema.js]")]
  node_stats_records[("Usage counters<br/>[statsSchema.js]")]
end

subgraph group_reporting["Steam reporting"]
  node_report_command["Report workflow<br/>[report.js]"]
  node_report_data["Account report history<br/>[reportData.json]"]
end

subgraph group_monitoring["Ban monitoring"]
  node_watch_command["Watch command<br/>[watchlist.js]"]
end

node_discord_users(("Discord users"))
node_discord(("Discord"))
node_steam(("Steam Community"))
node_proxy_service(("Proxy endpoints"))

node_discord_users -->|"send commands"| node_discord
node_discord -.->|"delivers messages"| node_message_events
node_discord -.->|"delivers DMs"| node_dm_events
node_app -.->|"loads handlers"| node_message_events
node_app -->|"logs in"| node_discord
node_message_events -->|"dispatches commands"| node_general_commands
node_dm_events -->|"dispatches commands"| node_general_commands
node_report_command -->|"checks balance"| node_user_records
node_report_command -->|"checks whitelist"| node_whitelist_records
node_report_command -->|"increments reports"| node_stats_records
node_report_command -->|"reads and writes"| node_report_data
node_report_command -->|"submits reports"| node_steam
node_report_command -->|"routes requests"| node_proxy_service
node_report_command -->|"sends status"| node_discord
node_watch_command -->|"adds watched profile"| node_ban_check
node_redeem_command -->|"consumes key"| node_key_records
node_redeem_command -->|"credits balance"| node_user_records
node_redeem_command -->|"assigns role"| node_discord
node_balance_command -->|"reads balance"| node_user_records
node_whitelist_command -->|"manages entries"| node_whitelist_records
node_app -->|"checks watched users"| node_ban_check
node_app -->|"checks bans"| node_steam
node_app -->|"notifies ban channel"| node_discord
node_app -->|"updates counters"| node_stats_records
node_app -->|"counts entries"| node_whitelist_records
node_app -->|"updates channel counts"| node_discord

click node_app "https://github.com/kazzyapi/steam-report-bot/blob/main/app.js"
click node_message_events "https://github.com/kazzyapi/steam-report-bot/blob/main/events/guild/message.js"
click node_dm_events "https://github.com/kazzyapi/steam-report-bot/blob/main/events/guild/dm.js"
click node_general_commands "https://github.com/kazzyapi/steam-report-bot/tree/main/Commands/General"
click node_report_command "https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/report.js"
click node_watch_command "https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/watchlist.js"
click node_key_commands "https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/genkey.js"
click node_redeem_command "https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/redeem.js"
click node_balance_command "https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/balance.js"
click node_whitelist_command "https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/whitelist.js"
click node_ban_check "https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/banCheckSchema.js"
click node_user_records "https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/userSchema.js"
click node_key_records "https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/keySchema.js"
click node_whitelist_records "https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/whitelistSchema.js"
click node_stats_records "https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/statsSchema.js"
click node_report_data "https://github.com/kazzyapi/steam-report-bot/blob/main/reportData.json"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_app,node_message_events,node_dm_events,node_discord_users toneBlue
class node_general_commands,node_key_commands,node_redeem_command,node_balance_command,node_whitelist_command toneAmber
class node_ban_check,node_user_records,node_key_records,node_whitelist_records,node_stats_records toneMint
class node_report_command,node_report_data toneRose
class node_watch_command,node_discord,node_steam,node_proxy_service toneIndigo
```

## Components

### Bot runtime

- [Bot bootstrap](https://github.com/kazzyapi/steam-report-bot/blob/main/app.js): `app.js`
- [Message dispatch](https://github.com/kazzyapi/steam-report-bot/blob/main/events/guild/message.js): `events/guild/message.js`
- [DM dispatch](https://github.com/kazzyapi/steam-report-bot/blob/main/events/guild/dm.js): `events/guild/dm.js`

### User commands

- [General commands](https://github.com/kazzyapi/steam-report-bot/tree/main/Commands/General): `Commands/General`
- [Key management](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/genkey.js): `Commands/General/genkey.js`
- [Redeem key](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/redeem.js): `Commands/General/redeem.js`
- [Balance lookup](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/balance.js): `Commands/General/balance.js`
- [Whitelist control](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/whitelist.js): `Commands/General/whitelist.js`

### MongoDB records

- [Watched profiles](https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/banCheckSchema.js): `Schemas/banCheckSchema.js`
- [User balances](https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/userSchema.js): `Schemas/userSchema.js`
- [Redeemable keys](https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/keySchema.js): `Schemas/keySchema.js`
- [Whitelist entries](https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/whitelistSchema.js): `Schemas/whitelistSchema.js`
- [Usage counters](https://github.com/kazzyapi/steam-report-bot/blob/main/Schemas/statsSchema.js): `Schemas/statsSchema.js`

### Steam reporting

- [Report workflow](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/report.js): `Commands/General/report.js`
- [Account report history](https://github.com/kazzyapi/steam-report-bot/blob/main/reportData.json): `reportData.json`

### Ban monitoring

- [Watch command](https://github.com/kazzyapi/steam-report-bot/blob/main/Commands/General/watchlist.js): `Commands/General/watchlist.js`

### Other components

- **Discord users**
- **Discord**
- **Steam Community**
- **Proxy endpoints**

## Connections

- Discord users → Discord: send commands (evidence: `README.md`)
- Discord → Message dispatch: delivers messages
- Discord → DM dispatch: delivers DMs
- Bot bootstrap → Message dispatch: loads handlers
- Bot bootstrap → Discord: logs in (evidence: `app.js`)
- Message dispatch → General commands: dispatches commands (evidence: `events/guild/message.js`)
- DM dispatch → General commands: dispatches commands (evidence: `events/guild/dm.js`)
- Report workflow → User balances: checks balance (evidence: `Commands/General/report.js`)
- Report workflow → Whitelist entries: checks whitelist (evidence: `Commands/General/report.js`)
- Report workflow → Usage counters: increments reports (evidence: `Commands/General/report.js`)
- Report workflow → Account report history: reads and writes (evidence: `Commands/General/report.js`)
- Report workflow → Steam Community: submits reports (evidence: `Commands/General/report.js`)
- Report workflow → Proxy endpoints: routes requests (evidence: `Commands/General/report.js`)
- Report workflow → Discord: sends status (evidence: `Commands/General/report.js`)
- Watch command → Watched profiles: adds watched profile (evidence: `Commands/General/watchlist.js`)
- Redeem key → Redeemable keys: consumes key (evidence: `Commands/General/redeem.js`)
- Redeem key → User balances: credits balance (evidence: `Commands/General/redeem.js`)
- Redeem key → Discord: assigns role (evidence: `Commands/General/redeem.js`)
- Balance lookup → User balances: reads balance (evidence: `Commands/General/balance.js`)
- Whitelist control → Whitelist entries: manages entries (evidence: `Commands/General/whitelist.js`)
- Bot bootstrap → Watched profiles: checks watched users (evidence: `app.js`)
- Bot bootstrap → Steam Community: checks bans (evidence: `app.js`)
- Bot bootstrap → Discord: notifies ban channel (evidence: `app.js`)
- Bot bootstrap → Usage counters: updates counters (evidence: `app.js`)
- Bot bootstrap → Whitelist entries: counts entries (evidence: `app.js`)
- Bot bootstrap → Discord: updates channel counts (evidence: `app.js`)
