# bluehorizon65/discord-bot architecture

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

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

## Overview

This is a Discord bot combining SoundCloud music playback and Valorant lookup tools. Discord interactions enter through the client dispatcher, which routes slash commands and music buttons; music commands delegate playback and queue controls to the player. Valorant commands provide stats, rank, match, account-related, and skin features, with sampled code confirming external API use for stats and skins. Several command implementations are indexed but not excerpted, so their details and external dependencies are not inferred.

Main entry points: [`index.js`](https://github.com/bluehorizon65/discord-bot/blob/main/index.js) (Interaction dispatcher), [`music/player.js`](https://github.com/bluehorizon65/discord-bot/blob/main/music/player.js) (Queue and player), [`commands/play.js`](https://github.com/bluehorizon65/discord-bot/blob/main/commands/play.js) (Play command), [`commands/pause.js`](https://github.com/bluehorizon65/discord-bot/blob/main/commands/pause.js) (Pause command)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Discord runtime"]
  node_dispatcher["Interaction dispatcher<br/>[index.js]"]
  node_chat["Chat command<br/>[chat.js]"]
end

subgraph group_music["Music playback"]
  node_music_commands["Music commands"]
  node_play["Play command<br/>[play.js]"]
  node_pause["Pause command<br/>[pause.js]"]
  node_resume["Resume command<br/>[resume.js]"]
  node_skip["Skip command<br/>[skip.js]"]
  node_stop["Stop command<br/>[stop.js]"]
  node_queue["Queue command<br/>[queue.js]"]
  node_volume["Volume command<br/>[volume.js]"]
  node_player["Queue and player<br/>[player.js]"]
end

subgraph group_valorant["Valorant tools"]
  node_stats["Player stats<br/>[stats.js]"]
  node_skins["Skin browser<br/>[skins.js]"]
  node_rank["Rank lookup<br/>[rank.js]"]
  node_match["Match lookup<br/>[match.js]"]
  node_valorant["Valorant command<br/>[valorant.js]"]
end

node_discord(("Discord user"))
node_soundcloud["SoundCloud"]
node_voice["Discord voice"]
node_henrik["HenrikDev API"]
node_valorant_api["Valorant API"]

node_discord -->|"sends interaction"| node_dispatcher
node_dispatcher -->|"dispatches command"| node_play
node_dispatcher -->|"dispatches command"| node_pause
node_dispatcher -->|"dispatches command"| node_resume
node_dispatcher -->|"dispatches command"| node_skip
node_dispatcher -->|"dispatches command"| node_stop
node_dispatcher -->|"dispatches command"| node_queue
node_dispatcher -->|"dispatches command"| node_volume
node_dispatcher -->|"dispatches command"| node_stats
node_dispatcher -->|"dispatches command"| node_skins
node_dispatcher -->|"dispatches command"| node_rank
node_dispatcher -->|"dispatches command"| node_match
node_dispatcher -->|"dispatches command"| node_valorant
node_dispatcher -->|"dispatches command"| node_chat
node_play -->|"adds track"| node_player
node_pause -->|"pauses playback"| node_player
node_resume -->|"resumes playback"| node_player
node_skip -->|"skips track"| node_player
node_stop -->|"stops queue"| node_player
node_queue -->|"reads queue"| node_player
node_volume -->|"sets volume"| node_player
node_player -->|"searches and streams"| node_soundcloud
node_player -->|"joins and plays audio"| node_voice
node_stats -->|"fetches player data"| node_henrik
node_skins -->|"fetches skins"| node_valorant_api
node_dispatcher -->|"routes music buttons"| node_player

click node_dispatcher "https://github.com/bluehorizon65/discord-bot/blob/main/index.js"
click node_music_commands "https://github.com/bluehorizon65/discord-bot/tree/main/commands"
click node_play "https://github.com/bluehorizon65/discord-bot/blob/main/commands/play.js"
click node_pause "https://github.com/bluehorizon65/discord-bot/blob/main/commands/pause.js"
click node_resume "https://github.com/bluehorizon65/discord-bot/blob/main/commands/resume.js"
click node_skip "https://github.com/bluehorizon65/discord-bot/blob/main/commands/skip.js"
click node_stop "https://github.com/bluehorizon65/discord-bot/blob/main/commands/stop.js"
click node_queue "https://github.com/bluehorizon65/discord-bot/blob/main/commands/queue.js"
click node_volume "https://github.com/bluehorizon65/discord-bot/blob/main/commands/volume.js"
click node_player "https://github.com/bluehorizon65/discord-bot/blob/main/music/player.js"
click node_stats "https://github.com/bluehorizon65/discord-bot/blob/main/commands/stats.js"
click node_skins "https://github.com/bluehorizon65/discord-bot/blob/main/commands/skins.js"
click node_rank "https://github.com/bluehorizon65/discord-bot/blob/main/commands/rank.js"
click node_match "https://github.com/bluehorizon65/discord-bot/blob/main/commands/match.js"
click node_valorant "https://github.com/bluehorizon65/discord-bot/blob/main/commands/valorant.js"
click node_chat "https://github.com/bluehorizon65/discord-bot/blob/main/commands/chat.js"

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_dispatcher,node_chat,node_discord toneBlue
class node_music_commands,node_play,node_pause,node_resume,node_skip,node_stop,node_queue,node_volume,node_player toneAmber
class node_stats,node_skins,node_rank,node_match,node_valorant,node_henrik,node_valorant_api toneMint
class node_soundcloud,node_voice toneIndigo
```

## Components

### Discord runtime

- [Interaction dispatcher](https://github.com/bluehorizon65/discord-bot/blob/main/index.js): `index.js`
- [Chat command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/chat.js): `commands/chat.js`

### Music playback

- [Music commands](https://github.com/bluehorizon65/discord-bot/tree/main/commands): `commands`
- [Play command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/play.js): `commands/play.js`
- [Pause command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/pause.js): `commands/pause.js`
- [Resume command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/resume.js): `commands/resume.js`
- [Skip command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/skip.js): `commands/skip.js`
- [Stop command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/stop.js): `commands/stop.js`
- [Queue command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/queue.js): `commands/queue.js`
- [Volume command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/volume.js): `commands/volume.js`
- [Queue and player](https://github.com/bluehorizon65/discord-bot/blob/main/music/player.js): `music/player.js`

### Valorant tools

- [Player stats](https://github.com/bluehorizon65/discord-bot/blob/main/commands/stats.js): `commands/stats.js`
- [Skin browser](https://github.com/bluehorizon65/discord-bot/blob/main/commands/skins.js): `commands/skins.js`
- [Rank lookup](https://github.com/bluehorizon65/discord-bot/blob/main/commands/rank.js): `commands/rank.js`
- [Match lookup](https://github.com/bluehorizon65/discord-bot/blob/main/commands/match.js): `commands/match.js`
- [Valorant command](https://github.com/bluehorizon65/discord-bot/blob/main/commands/valorant.js): `commands/valorant.js`

### Other components

- **Discord user**
- **SoundCloud**
- **Discord voice**
- **HenrikDev API**
- **Valorant API**

## Connections

- Discord user → Interaction dispatcher: sends interaction (evidence: `index.js`)
- Interaction dispatcher → Play command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Pause command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Resume command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Skip command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Stop command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Queue command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Volume command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Player stats: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Skin browser: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Rank lookup: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Match lookup: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Valorant command: dispatches command (evidence: `index.js`)
- Interaction dispatcher → Chat command: dispatches command (evidence: `index.js`)
- Play command → Queue and player: adds track (evidence: `commands/play.js`)
- Pause command → Queue and player: pauses playback (evidence: `commands/pause.js`)
- Resume command → Queue and player: resumes playback (evidence: `commands/resume.js`)
- Skip command → Queue and player: skips track (evidence: `commands/skip.js`)
- Stop command → Queue and player: stops queue (evidence: `commands/stop.js`)
- Queue command → Queue and player: reads queue (evidence: `commands/queue.js`)
- Volume command → Queue and player: sets volume (evidence: `commands/volume.js`)
- Queue and player → SoundCloud: searches and streams (evidence: `music/player.js`)
- Queue and player → Discord voice: joins and plays audio (evidence: `music/player.js`)
- Player stats → HenrikDev API: fetches player data (evidence: `commands/stats.js`)
- Skin browser → Valorant API: fetches skins (evidence: `commands/skins.js`)
- Interaction dispatcher → Queue and player: routes music buttons (evidence: `index.js`)
