# lordm121/roulette-discord-bot architecture

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

- Interactive diagram: https://gitdiagram.com/lordm121/roulette-discord-bot
- Repository: https://github.com/lordm121/roulette-discord-bot

## Overview

This is a Discord roulette-game bot. Players start a lobby with a slash command, join or leave through buttons, then the bot runs timed rounds: a wheel selects a player, who chooses someone to remove; the final player wins. The sampled code shows the Discord interaction handler coordinating game state, timing, and wheel rendering. The README is empty, and omitted portions of index.js limit visibility into some round and winner details.

Main entry points: [`index.js`](https://github.com/lordm121/roulette-discord-bot/blob/main/index.js) (Interaction handler), [`wheel.js`](https://github.com/lordm121/roulette-discord-bot/blob/main/wheel.js) (Wheel image generator), [`utils.js`](https://github.com/lordm121/roulette-discord-bot/blob/main/utils.js) (Button helpers), [`config.json`](https://github.com/lordm121/roulette-discord-bot/blob/main/config.json) (Timing configuration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_discord["Discord interface"]
  node_handler["Interaction handler<br/>[index.js]"]
  node_button_helpers["Button helpers<br/>[utils.js]"]
end

subgraph group_game["Roulette game"]
  node_game_state["Game state and rounds<br/>[index.js]"]
  node_game_config["Timing configuration<br/>[config.json]"]
end

subgraph group_rendering["Wheel rendering"]
  node_wheel["Wheel image generator<br/>[wheel.js]"]
  node_wheel_assets["Wheel assets"]
end

node_players(("Players"))
node_discord["Discord"]

node_players -->|"use commands"| node_discord
node_discord -->|"delivers interactions"| node_handler
node_handler -->|"sends game messages"| node_discord
node_handler -->|"reads timing"| node_game_config
node_handler -->|"edits buttons"| node_button_helpers
node_handler -->|"requests image"| node_wheel
node_wheel -->|"loads fonts and pointer"| node_wheel_assets

click node_handler "https://github.com/lordm121/roulette-discord-bot/blob/main/index.js"
click node_game_state "https://github.com/lordm121/roulette-discord-bot/blob/main/index.js"
click node_game_config "https://github.com/lordm121/roulette-discord-bot/blob/main/config.json"
click node_button_helpers "https://github.com/lordm121/roulette-discord-bot/blob/main/utils.js"
click node_wheel "https://github.com/lordm121/roulette-discord-bot/blob/main/wheel.js"
click node_wheel_assets "https://github.com/lordm121/roulette-discord-bot/tree/main/assets"

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_handler,node_button_helpers toneBlue
class node_game_state,node_game_config toneAmber
class node_wheel,node_wheel_assets toneMint
class node_players,node_discord toneIndigo
```

## Components

### Discord interface

- [Interaction handler](https://github.com/lordm121/roulette-discord-bot/blob/main/index.js): `index.js`
- [Button helpers](https://github.com/lordm121/roulette-discord-bot/blob/main/utils.js): `utils.js`

### Roulette game

- [Game state and rounds](https://github.com/lordm121/roulette-discord-bot/blob/main/index.js): `index.js`
- [Timing configuration](https://github.com/lordm121/roulette-discord-bot/blob/main/config.json): `config.json`

### Wheel rendering

- [Wheel image generator](https://github.com/lordm121/roulette-discord-bot/blob/main/wheel.js): `wheel.js`
- [Wheel assets](https://github.com/lordm121/roulette-discord-bot/tree/main/assets): `assets`

### Other components

- **Players**
- **Discord**

## Connections

- Players → Discord: use commands
- Discord → Interaction handler: delivers interactions (evidence: `index.js`)
- Interaction handler → Discord: sends game messages (evidence: `index.js`)
- Interaction handler → Timing configuration: reads timing (evidence: `index.js`)
- Interaction handler → Button helpers: edits buttons (evidence: `index.js`)
- Interaction handler → Wheel image generator: requests image (evidence: `index.js`)
- Wheel image generator → Wheel assets: loads fonts and pointer (evidence: `wheel.js`)
