# rektive/garminbot architecture

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

- Interactive diagram: https://gitdiagram.com/rektive/garminbot
- Repository: https://github.com/rektive/garminbot

## Overview

Dicrod Bot is an event-driven Discord community and server-administration bot. Its main workflow is a member or administrator interacting with Discord, the runtime in `index.js` dispatching an event or command, and a feature module performing the requested action and responding through Discord. Major branches include music playback and saved playlists, voice-channel management, moderation and role automation, scheduled events, and messaging. The README documents broader real-time data and engagement capabilities, but the supplied excerpts do not establish their detailed wiring; uncertain links are omitted.

Main entry points: [`index.js`](https://github.com/rektive/garminbot/blob/main/index.js) (Event and command runtime), [`commands/play.js`](https://github.com/rektive/garminbot/blob/main/commands/play.js) (Music playback), [`commands/playlist_button.js`](https://github.com/rektive/garminbot/blob/main/commands/playlist_button.js) (Playlist management), [`send_msg_track.js`](https://github.com/rektive/garminbot/blob/main/send_msg_track.js) (Online DM queue)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_runtime["Event and command runtime<br/>[index.js]"]
end

subgraph group_music["Music features"]
  node_music_engine["Music playback<br/>[play.js]"]
  node_music_ui["Music search and library<br/>[music_ui.js]"]
  node_music_buttons["Saved music buttons<br/>[music_button.js]"]
  node_playlists["Playlist management<br/>[playlist_button.js]"]
  node_music_state[("Saved music data<br/>[playlist_button.js]")]
end

subgraph group_server["Server management"]
  node_voice_tools["Voice channel tools"]
  node_moderation["Moderation and roles"]
end

subgraph group_community["Community tools"]
  node_scheduling["Scheduled events<br/>[schedule_button.js]"]
  node_direct_message["Direct messaging<br/>[send_msg.js]"]
  node_queued_message["Online DM queue<br/>[send_msg_track.js]"]
  node_dm_state[("Queued message data<br/>[send_msg_track.js]")]
  node_engagement["Engagement commands"]
end

node_member(("Discord member"))
node_discord["Discord platform"]
node_music_services["Music providers"]

node_member -->|"interacts"| node_discord
node_discord -->|"delivers events"| node_runtime
node_runtime -->|"sends responses"| node_discord
node_runtime -->|"dispatches commands"| node_music_engine
node_runtime -->|"dispatches interactions"| node_music_ui
node_runtime -->|"dispatches interactions"| node_music_buttons
node_runtime -->|"dispatches interactions"| node_playlists
node_music_ui -->|"starts playback"| node_music_engine
node_playlists -->|"queues songs"| node_music_engine
node_music_buttons -->|"requests playback"| node_music_engine
node_music_engine -.->|"resolves tracks"| node_music_services
node_playlists -->|"reads and writes"| node_music_state
node_runtime -->|"dispatches commands"| node_voice_tools
node_runtime -->|"dispatches commands"| node_moderation
node_runtime -->|"dispatches interactions"| node_scheduling
node_runtime -->|"dispatches commands"| node_direct_message
node_runtime -->|"dispatches commands and status events"| node_queued_message
node_queued_message -->|"reads and writes"| node_dm_state
node_queued_message -->|"delivers queued DMs"| node_discord
node_direct_message -->|"sends DMs"| node_discord
node_runtime -->|"dispatches commands"| node_engagement

click node_runtime "https://github.com/rektive/garminbot/blob/main/index.js"
click node_music_engine "https://github.com/rektive/garminbot/blob/main/commands/play.js"
click node_music_ui "https://github.com/rektive/garminbot/blob/main/commands/music_ui.js"
click node_music_buttons "https://github.com/rektive/garminbot/blob/main/commands/music_button.js"
click node_playlists "https://github.com/rektive/garminbot/blob/main/commands/playlist_button.js"
click node_music_state "https://github.com/rektive/garminbot/blob/main/commands/playlist_button.js"
click node_voice_tools "https://github.com/rektive/garminbot/tree/main/commands"
click node_moderation "https://github.com/rektive/garminbot/tree/main/commands"
click node_scheduling "https://github.com/rektive/garminbot/blob/main/commands/schedule_button.js"
click node_direct_message "https://github.com/rektive/garminbot/blob/main/send_msg.js"
click node_queued_message "https://github.com/rektive/garminbot/blob/main/send_msg_track.js"
click node_dm_state "https://github.com/rektive/garminbot/blob/main/send_msg_track.js"
click node_engagement "https://github.com/rektive/garminbot/tree/main/commands"

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_runtime toneBlue
class node_music_engine,node_music_ui,node_music_buttons,node_playlists,node_music_state toneAmber
class node_voice_tools,node_moderation toneMint
class node_scheduling,node_direct_message,node_queued_message,node_dm_state,node_engagement toneRose
class node_member,node_discord,node_music_services toneIndigo
```

## Components

### Bot runtime

- [Event and command runtime](https://github.com/rektive/garminbot/blob/main/index.js): `index.js`

### Music features

- [Music playback](https://github.com/rektive/garminbot/blob/main/commands/play.js): `commands/play.js`
- [Music search and library](https://github.com/rektive/garminbot/blob/main/commands/music_ui.js): `commands/music_ui.js`
- [Saved music buttons](https://github.com/rektive/garminbot/blob/main/commands/music_button.js): `commands/music_button.js`
- [Playlist management](https://github.com/rektive/garminbot/blob/main/commands/playlist_button.js): `commands/playlist_button.js`
- [Saved music data](https://github.com/rektive/garminbot/blob/main/commands/playlist_button.js): `commands/playlist_button.js`

### Server management

- [Voice channel tools](https://github.com/rektive/garminbot/tree/main/commands): `commands`
- [Moderation and roles](https://github.com/rektive/garminbot/tree/main/commands): `commands`

### Community tools

- [Scheduled events](https://github.com/rektive/garminbot/blob/main/commands/schedule_button.js): `commands/schedule_button.js`
- [Direct messaging](https://github.com/rektive/garminbot/blob/main/send_msg.js): `send_msg.js`
- [Online DM queue](https://github.com/rektive/garminbot/blob/main/send_msg_track.js): `send_msg_track.js`
- [Queued message data](https://github.com/rektive/garminbot/blob/main/send_msg_track.js): `send_msg_track.js`
- [Engagement commands](https://github.com/rektive/garminbot/tree/main/commands): `commands`

### Other components

- **Discord member**
- **Discord platform**
- **Music providers**

## Connections

- Discord member → Discord platform: interacts
- Discord platform → Event and command runtime: delivers events
- Event and command runtime → Discord platform: sends responses
- Event and command runtime → Music playback: dispatches commands
- Event and command runtime → Music search and library: dispatches interactions
- Event and command runtime → Saved music buttons: dispatches interactions
- Event and command runtime → Playlist management: dispatches interactions
- Music search and library → Music playback: starts playback
- Playlist management → Music playback: queues songs
- Saved music buttons → Music playback: requests playback
- Music playback → Music providers: resolves tracks
- Playlist management → Saved music data: reads and writes
- Event and command runtime → Voice channel tools: dispatches commands
- Event and command runtime → Moderation and roles: dispatches commands
- Event and command runtime → Scheduled events: dispatches interactions
- Event and command runtime → Direct messaging: dispatches commands
- Event and command runtime → Online DM queue: dispatches commands and status events
- Online DM queue → Queued message data: reads and writes
- Online DM queue → Discord platform: delivers queued DMs
- Direct messaging → Discord platform: sends DMs
- Event and command runtime → Engagement commands: dispatches commands
