# arsenialiakseichyk/discord_bot architecture

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

- Interactive diagram: https://gitdiagram.com/arsenialiakseichyk/discord_bot
- Repository: https://github.com/arsenialiakseichyk/discord_bot

## Overview

Discord Music Bot: users issue slash commands to request YouTube or local tracks, which are queued, prepared, and played in a voice channel; playback status and controls are presented in Discord. Separate command branches manage voice channels, announcements, and custom embed construction. The queue, player, and shared state form the core runtime. Some command implementations were not sampled, so their documented capabilities are included with README-backed relationships; unsampled internal calls are omitted.

Main entry points: [`commands/register.py`](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/register.py) (Slash Command Registration), [`core/state.py`](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/state.py) (Playback State), [`core/queue_manager.py`](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/queue_manager.py) (Queue Processing), [`core/player.py`](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/player.py) (Audio Player)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot Runtime"]
  node_bot["Bot Application<br/>[bot.py]"]
  node_registration["Slash Command Registration<br/>[register.py]"]
  node_settings["Bot Settings<br/>[settings.py]"]
end

subgraph group_commands["Music Commands"]
  node_play_command["Play Command<br/>[play.py]"]
  node_now_command["Now Playing<br/>[now.py]"]
  node_queue_command["Queue View<br/>[queue.py]"]
  node_shuffle_command["Shuffle Queue<br/>[shuffle.py]"]
  node_clear_command["Clear Queue<br/>[clear.py]"]
end

subgraph group_playback["Playback Core"]
  node_queue_manager["Queue Processing<br/>[queue_manager.py]"]
  node_state["Playback State<br/>[state.py]"]
  node_player["Audio Player<br/>[player.py]"]
  node_controls["Playback Controls<br/>[controls.py]"]
  node_voice["Voice Connection<br/>[voice.py]"]
end

subgraph group_community["Voice And Admin"]
  node_join_command["Join Voice<br/>[join.py]"]
  node_jointo_command["Join Specific Channel<br/>[jointo.py]"]
  node_leave_command["Leave Voice<br/>[leave.py]"]
  node_announce_command["Announcements<br/>[announce.py]"]
  node_constructor_command["Embed Builder<br/>[constructor.py]"]
  node_help_command["Help Command<br/>[help.py]"]
end

subgraph group_integrations["External Services"]
  node_discord["Discord Platform"]
  node_youtube["YouTube Metadata<br/>[yt_utils.py]"]
  node_music_folder[("Local Music Files")]
  node_ffmpeg["FFmpeg"]
end

node_user(("Discord User"))

node_user -->|"uses commands"| node_bot
node_bot -->|"registers commands"| node_registration
node_bot -->|"starts processing"| node_queue_manager
node_bot -->|"uses state"| node_state
node_bot -->|"loads settings"| node_settings
node_registration -->|"registers"| node_play_command
node_registration -->|"registers"| node_now_command
node_registration -->|"registers"| node_queue_command
node_registration -->|"registers"| node_shuffle_command
node_registration -->|"registers"| node_clear_command
node_registration -->|"registers"| node_join_command
node_registration -->|"registers"| node_jointo_command
node_registration -->|"registers"| node_leave_command
node_registration -->|"registers"| node_announce_command
node_registration -->|"registers"| node_constructor_command
node_registration -->|"registers"| node_help_command
node_play_command -->|"connects to"| node_voice
node_play_command -->|"enqueues request"| node_state
node_queue_manager -->|"updates queue"| node_state
node_queue_manager -->|"fetches metadata"| node_youtube
node_queue_manager -->|"reads music path"| node_settings
node_queue_manager -->|"starts playback"| node_player
node_player -->|"reads playback state"| node_state
node_player -->|"resolves audio stream"| node_youtube
node_player -->|"prepares audio"| node_ffmpeg
node_player -->|"renders controls"| node_controls
node_queue_manager -->|"refreshes controls"| node_controls
node_player -->|"plays voice audio"| node_discord
node_voice -->|"uses voice settings"| node_settings
node_voice -->|"connects voice"| node_discord
node_controls -->|"reads and updates"| node_state
node_now_command -->|"reads playback details"| node_state
node_queue_command -->|"reads queue"| node_state
node_shuffle_command -->|"shuffles queue"| node_state
node_clear_command -->|"clears queue"| node_state
node_join_command -->|"connects to"| node_voice
node_jointo_command -->|"connects to channel"| node_voice
node_leave_command -->|"clears playback state"| node_state
node_announce_command -->|"reads announcement settings"| node_settings
node_announce_command -->|"publishes announcement"| node_discord
node_constructor_command -->|"publishes custom embed"| node_discord
node_queue_manager -->|"checks local files"| node_music_folder

click node_bot "https://github.com/arsenialiakseichyk/discord_bot/blob/release/bot.py"
click node_registration "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/register.py"
click node_play_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/play.py"
click node_now_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/now.py"
click node_queue_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/queue.py"
click node_shuffle_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/shuffle.py"
click node_clear_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/clear.py"
click node_queue_manager "https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/queue_manager.py"
click node_state "https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/state.py"
click node_player "https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/player.py"
click node_controls "https://github.com/arsenialiakseichyk/discord_bot/blob/release/ui/controls.py"
click node_voice "https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/voice.py"
click node_youtube "https://github.com/arsenialiakseichyk/discord_bot/blob/release/utils/yt_utils.py"
click node_settings "https://github.com/arsenialiakseichyk/discord_bot/blob/release/config/settings.py"
click node_join_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/join.py"
click node_jointo_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/jointo.py"
click node_leave_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/leave.py"
click node_announce_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/announce.py"
click node_constructor_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/constructor.py"
click node_help_command "https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/help.py"

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_bot,node_registration,node_settings,node_user toneBlue
class node_play_command,node_now_command,node_queue_command,node_shuffle_command,node_clear_command toneAmber
class node_queue_manager,node_state,node_player,node_controls,node_voice toneMint
class node_join_command,node_jointo_command,node_leave_command,node_announce_command,node_constructor_command,node_help_command toneRose
class node_discord,node_youtube,node_music_folder,node_ffmpeg toneIndigo
```

## Components

### Bot Runtime

- [Bot Application](https://github.com/arsenialiakseichyk/discord_bot/blob/release/bot.py): `bot.py`
- [Slash Command Registration](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/register.py): `commands/register.py`
- [Bot Settings](https://github.com/arsenialiakseichyk/discord_bot/blob/release/config/settings.py): `config/settings.py`

### Music Commands

- [Play Command](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/play.py): `commands/music/play.py`
- [Now Playing](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/now.py): `commands/music/now.py`
- [Queue View](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/queue.py): `commands/music/queue.py`
- [Shuffle Queue](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/shuffle.py): `commands/music/shuffle.py`
- [Clear Queue](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/music/clear.py): `commands/music/clear.py`

### Playback Core

- [Queue Processing](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/queue_manager.py): `core/queue_manager.py`
- [Playback State](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/state.py): `core/state.py`
- [Audio Player](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/player.py): `core/player.py`
- [Playback Controls](https://github.com/arsenialiakseichyk/discord_bot/blob/release/ui/controls.py): `ui/controls.py`
- [Voice Connection](https://github.com/arsenialiakseichyk/discord_bot/blob/release/core/voice.py): `core/voice.py`

### Voice And Admin

- [Join Voice](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/join.py): `commands/utility/join.py`
- [Join Specific Channel](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/jointo.py): `commands/utility/jointo.py`
- [Leave Voice](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/leave.py): `commands/utility/leave.py`
- [Announcements](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/announce.py): `commands/utility/announce.py`
- [Embed Builder](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/constructor.py): `commands/utility/constructor.py`
- [Help Command](https://github.com/arsenialiakseichyk/discord_bot/blob/release/commands/utility/help.py): `commands/utility/help.py`

### External Services

- **Discord Platform**
- [YouTube Metadata](https://github.com/arsenialiakseichyk/discord_bot/blob/release/utils/yt_utils.py): `utils/yt_utils.py`
- **Local Music Files**
- **FFmpeg**

### Other components

- **Discord User**

## Connections

- Discord User → Bot Application: uses commands (evidence: `Readme.md`)
- Bot Application → Slash Command Registration: registers commands (evidence: `bot.py`)
- Bot Application → Queue Processing: starts processing (evidence: `bot.py`)
- Bot Application → Playback State: uses state (evidence: `bot.py`)
- Bot Application → Bot Settings: loads settings (evidence: `bot.py`)
- Slash Command Registration → Play Command: registers (evidence: `commands/register.py`)
- Slash Command Registration → Now Playing: registers (evidence: `commands/register.py`)
- Slash Command Registration → Queue View: registers (evidence: `commands/register.py`)
- Slash Command Registration → Shuffle Queue: registers (evidence: `commands/register.py`)
- Slash Command Registration → Clear Queue: registers (evidence: `commands/register.py`)
- Slash Command Registration → Join Voice: registers (evidence: `commands/register.py`)
- Slash Command Registration → Join Specific Channel: registers (evidence: `commands/register.py`)
- Slash Command Registration → Leave Voice: registers (evidence: `commands/register.py`)
- Slash Command Registration → Announcements: registers (evidence: `commands/register.py`)
- Slash Command Registration → Embed Builder: registers (evidence: `commands/register.py`)
- Slash Command Registration → Help Command: registers (evidence: `commands/register.py`)
- Play Command → Voice Connection: connects to (evidence: `commands/music/play.py`)
- Play Command → Playback State: enqueues request (evidence: `commands/music/play.py`)
- Queue Processing → Playback State: updates queue (evidence: `core/queue_manager.py`)
- Queue Processing → YouTube Metadata: fetches metadata (evidence: `core/queue_manager.py`)
- Queue Processing → Bot Settings: reads music path (evidence: `core/queue_manager.py`)
- Queue Processing → Audio Player: starts playback (evidence: `core/queue_manager.py`)
- Audio Player → Playback State: reads playback state (evidence: `core/player.py`)
- Audio Player → YouTube Metadata: resolves audio stream (evidence: `core/player.py`)
- Audio Player → FFmpeg: prepares audio (evidence: `core/player.py`)
- Audio Player → Playback Controls: renders controls (evidence: `core/player.py`)
- Queue Processing → Playback Controls: refreshes controls (evidence: `core/queue_manager.py`)
- Audio Player → Discord Platform: plays voice audio (evidence: `core/player.py`)
- Voice Connection → Bot Settings: uses voice settings (evidence: `core/voice.py`)
- Voice Connection → Discord Platform: connects voice (evidence: `core/voice.py`)
- Playback Controls → Playback State: reads and updates (evidence: `ui/controls.py`)
- Now Playing → Playback State: reads playback details (evidence: `commands/music/now.py`)
- Queue View → Playback State: reads queue (evidence: `commands/music/queue.py`)
- Shuffle Queue → Playback State: shuffles queue (evidence: `commands/music/shuffle.py`)
- Clear Queue → Playback State: clears queue (evidence: `commands/music/clear.py`)
- Join Voice → Voice Connection: connects to (evidence: `commands/utility/join.py`)
- Join Specific Channel → Voice Connection: connects to channel (evidence: `commands/utility/jointo.py`)
- Leave Voice → Playback State: clears playback state (evidence: `Readme.md`)
- Announcements → Bot Settings: reads announcement settings (evidence: `commands/utility/announce.py`)
- Announcements → Discord Platform: publishes announcement (evidence: `commands/utility/announce.py`)
- Embed Builder → Discord Platform: publishes custom embed (evidence: `commands/utility/constructor.py`)
- Queue Processing → Local Music Files: checks local files (evidence: `core/queue_manager.py`)
