# 0zunu/ameliabot-discord architecture

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

- Interactive diagram: https://gitdiagram.com/0zunu/ameliabot-discord
- Repository: https://github.com/0zunu/ameliabot-discord

## Overview

Amelia is a Discord music bot with message and slash-command interfaces, audio playback and queue/filter controls, server settings, and a web dashboard. The main user flow is a Discord request handled by the bot, which uses DisTube for playback or queue operations and responds in Discord; the dashboard provides a separate browser interface, including documented live queue control. The excerpts show the bot and dashboard setup, command behavior, and playback event handling, but not all runtime registration or dashboard routes, so some wiring is left unverified.

Main entry points: [`index.js`](https://github.com/0zunu/ameliabot-discord/blob/master/index.js) (DisTube playback), [`handlers/slashCommands.js`](https://github.com/0zunu/ameliabot-discord/blob/master/handlers/slashCommands.js) (Command dispatch), [`events/guild/interactionCreate.js`](https://github.com/0zunu/ameliabot-discord/blob/master/events/guild/interactionCreate.js) (Interaction events), [`dashboard/app.js`](https://github.com/0zunu/ameliabot-discord/blob/master/dashboard/app.js) (Dashboard routes)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_bot["Discord bot<br/>[index.js]"]
  node_message_events["Message events<br/>[messageCreate.js]"]
  node_interaction_events["Interaction events"]
  node_command_dispatch["Command dispatch<br/>[slashCommands.js]"]
  node_shared_functions["Command helpers<br/>[functions.js]"]
end

subgraph group_music["Music controls"]
  node_playback_engine["DisTube playback<br/>[index.js]"]
  node_music_commands["Playback commands"]
  node_queue_commands["Queue controls"]
  node_song_commands["Song controls"]
  node_filter_commands["Audio filters"]
  node_playback_events["Playback events<br/>[distubeEvent.js]"]
end

subgraph group_server["Server configuration"]
  node_settings_commands["Server settings"]
  node_settings_store[("Settings store<br/>[index.js]")]
end

subgraph group_web["Web dashboard"]
  node_dashboard_server["Dashboard server<br/>[index.js]"]
  node_dashboard_app["Dashboard routes<br/>[app.js]"]
end

node_discord_user(("Discord user"))
node_browser_user(("Dashboard user"))
node_discord_service["Discord service"]

node_discord_user -.->|"sends messages"| node_message_events
node_discord_user -.->|"sends commands"| node_interaction_events
node_message_events -->|"uses helpers"| node_shared_functions
node_interaction_events -->|"uses helpers"| node_shared_functions
node_interaction_events -.->|"dispatches commands"| node_command_dispatch
node_command_dispatch -.->|"routes commands"| node_music_commands
node_command_dispatch -.->|"routes commands"| node_queue_commands
node_command_dispatch -.->|"routes commands"| node_song_commands
node_command_dispatch -.->|"routes commands"| node_filter_commands
node_music_commands -.->|"requests playback"| node_playback_engine
node_queue_commands -.->|"controls queue"| node_playback_engine
node_song_commands -.->|"controls playback"| node_playback_engine
node_filter_commands -->|"sets filters"| node_playback_engine
node_playback_engine -.->|"emits events"| node_playback_events
node_settings_commands -->|"updates settings"| node_settings_store
node_bot -->|"initializes"| node_playback_engine
node_bot -->|"starts dashboard"| node_dashboard_server
node_browser_user -.->|"uses dashboard"| node_dashboard_app
node_dashboard_server -.->|"serves routes"| node_dashboard_app
node_dashboard_app -->|"reads bot state"| node_bot
node_discord_service -.->|"provides platform"| node_bot

click node_bot "https://github.com/0zunu/ameliabot-discord/blob/master/index.js"
click node_message_events "https://github.com/0zunu/ameliabot-discord/blob/master/events/guild/messageCreate.js"
click node_interaction_events "https://github.com/0zunu/ameliabot-discord/blob/master/events/guild/interactionCreate.js"
click node_command_dispatch "https://github.com/0zunu/ameliabot-discord/blob/master/handlers/slashCommands.js"
click node_shared_functions "https://github.com/0zunu/ameliabot-discord/blob/master/handlers/functions.js"
click node_playback_engine "https://github.com/0zunu/ameliabot-discord/blob/master/index.js"
click node_music_commands "https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Music"
click node_queue_commands "https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Queue"
click node_song_commands "https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Song"
click node_filter_commands "https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Filter"
click node_playback_events "https://github.com/0zunu/ameliabot-discord/blob/master/handlers/distubeEvent.js"
click node_settings_commands "https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Settings"
click node_settings_store "https://github.com/0zunu/ameliabot-discord/blob/master/index.js"
click node_dashboard_server "https://github.com/0zunu/ameliabot-discord/blob/master/dashboard/index.js"
click node_dashboard_app "https://github.com/0zunu/ameliabot-discord/blob/master/dashboard/app.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_bot,node_message_events,node_interaction_events,node_command_dispatch,node_shared_functions,node_discord_user,node_browser_user toneBlue
class node_playback_engine,node_music_commands,node_queue_commands,node_song_commands,node_filter_commands,node_playback_events toneAmber
class node_settings_commands,node_settings_store toneMint
class node_dashboard_server,node_dashboard_app toneRose
class node_discord_service toneIndigo
```

## Components

### Bot runtime

- [Discord bot](https://github.com/0zunu/ameliabot-discord/blob/master/index.js): `index.js`
- [Message events](https://github.com/0zunu/ameliabot-discord/blob/master/events/guild/messageCreate.js): `events/guild/messageCreate.js`
- [Interaction events](https://github.com/0zunu/ameliabot-discord/blob/master/events/guild/interactionCreate.js): `events/guild/interactionCreate.js`
- [Command dispatch](https://github.com/0zunu/ameliabot-discord/blob/master/handlers/slashCommands.js): `handlers/slashCommands.js`
- [Command helpers](https://github.com/0zunu/ameliabot-discord/blob/master/handlers/functions.js): `handlers/functions.js`

### Music controls

- [DisTube playback](https://github.com/0zunu/ameliabot-discord/blob/master/index.js): `index.js`
- [Playback commands](https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Music): `slashCommands/Music`
- [Queue controls](https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Queue): `slashCommands/Queue`
- [Song controls](https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Song): `slashCommands/Song`
- [Audio filters](https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Filter): `slashCommands/Filter`
- [Playback events](https://github.com/0zunu/ameliabot-discord/blob/master/handlers/distubeEvent.js): `handlers/distubeEvent.js`

### Server configuration

- [Server settings](https://github.com/0zunu/ameliabot-discord/tree/master/slashCommands/Settings): `slashCommands/Settings`
- [Settings store](https://github.com/0zunu/ameliabot-discord/blob/master/index.js): `index.js`

### Web dashboard

- [Dashboard server](https://github.com/0zunu/ameliabot-discord/blob/master/dashboard/index.js): `dashboard/index.js`
- [Dashboard routes](https://github.com/0zunu/ameliabot-discord/blob/master/dashboard/app.js): `dashboard/app.js`

### Other components

- **Discord user**
- **Dashboard user**
- **Discord service**

## Connections

- Discord user → Message events: sends messages (evidence: `README.md`)
- Discord user → Interaction events: sends commands (evidence: `README.md`)
- Message events → Command helpers: uses helpers (evidence: `events/guild/messageCreate.js`)
- Interaction events → Command helpers: uses helpers (evidence: `events/guild/interactionCreate.js`)
- Interaction events → Command dispatch: dispatches commands
- Command dispatch → Playback commands: routes commands
- Command dispatch → Queue controls: routes commands
- Command dispatch → Song controls: routes commands
- Command dispatch → Audio filters: routes commands
- Playback commands → DisTube playback: requests playback
- Queue controls → DisTube playback: controls queue
- Song controls → DisTube playback: controls playback
- Audio filters → DisTube playback: sets filters (evidence: `slashCommands/Filter/set.js`)
- DisTube playback → Playback events: emits events
- Server settings → Settings store: updates settings (evidence: `slashCommands/Settings/botchat.js`)
- Discord bot → DisTube playback: initializes (evidence: `index.js`)
- Discord bot → Dashboard server: starts dashboard (evidence: `index.js`)
- Dashboard user → Dashboard routes: uses dashboard (evidence: `README.md`)
- Dashboard server → Dashboard routes: serves routes
- Dashboard routes → Discord bot: reads bot state
- Discord service → Discord bot: provides platform (evidence: `README.md`)
