# bonee4/ayume architecture

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

- Interactive diagram: https://gitdiagram.com/bonee4/ayume
- Repository: https://github.com/bonee4/ayume

## Overview

Fuyumi is a sharded Discord bot centered on music playback, with server configuration, DJ controls, playlists, moderation logs, and utility commands. The main workflow starts with a Discord interaction, passes through command lookup and permission checks, then invokes a feature command; music commands use the Lavalink-backed player and may update playback statistics. The README is empty, so capabilities are inferred from the source tree. Several command implementations and event handlers were not sampled; their exact runtime connections are therefore left unasserted.

Main entry points: [`src/structures/Command.ts`](https://github.com/bonee4/ayume/blob/master/src/structures/Command.ts) (Command framework), [`src/structures/AyumeClient.ts`](https://github.com/bonee4/ayume/blob/master/src/structures/AyumeClient.ts) (Bot client), [`src/lavalink/index.ts`](https://github.com/bonee4/ayume/blob/master/src/lavalink/index.ts) (Lavalink player), [`src/structures/Utils.ts`](https://github.com/bonee4/ayume/blob/master/src/structures/Utils.ts) (Runtime utilities)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot Runtime"]
  node_entry["Client entry<br/>[Client.ts]"]
  node_client["Bot client<br/>[AyumeClient.ts]"]
  node_utils["Runtime utilities<br/>[Utils.ts]"]
  node_interactions["Interaction dispatch"]
  node_commands["Command framework<br/>[Command.ts]"]
  node_events["Event framework<br/>[Event.ts]"]
  node_logger["Logging<br/>[Logger.ts]"]
end

subgraph group_music["Music Playback"]
  node_music_commands["Music commands"]
  node_dj_commands["DJ controls"]
  node_player["Lavalink player<br/>[index.ts]"]
  node_play_stats["Playback statistics<br/>[index.ts]"]
  node_playlists["Playlist commands"]
end

subgraph group_guild["Guild Features"]
  node_admin_config["Server configuration"]
  node_guild_events["Guild lifecycle"]
  node_modlogs["Moderation logs"]
  node_guild_data[("Guild and user data<br/>[AyumeClient.ts]")]
end

subgraph group_support["User Support"]
  node_help["Help command<br/>[help.ts]"]
  node_utility_commands["Utility commands"]
  node_developer["Developer command<br/>[eval.ts]"]
end

node_discord(("Discord users"))

node_discord -->|"starts bot"| node_entry
node_entry -->|"creates client"| node_client
node_client -->|"constructs"| node_utils
node_client -->|"constructs"| node_player
node_client -->|"stores commands"| node_commands
node_client -->|"stores events"| node_events
node_client -->|"creates database client"| node_guild_data
node_client -->|"loads on start"| node_utils
node_utils -->|"loads command classes"| node_commands
node_utils -->|"loads event classes"| node_events
node_discord -.->|"sends interactions"| node_interactions
node_interactions -->|"looks up and runs"| node_commands
node_interactions -->|"reads and initializes"| node_guild_data
node_commands -.->|"dispatches to"| node_music_commands
node_commands -.->|"dispatches to"| node_dj_commands
node_commands -.->|"dispatches to"| node_playlists
node_commands -.->|"dispatches to"| node_admin_config
node_commands -.->|"dispatches to"| node_help
node_commands -.->|"dispatches to"| node_utility_commands
node_commands -.->|"dispatches to"| node_developer
node_music_commands -->|"searches and queues"| node_player
node_music_commands -->|"formats duration"| node_utils
node_dj_commands -.->|"controls playback"| node_player
node_playlists -.->|"uses playback"| node_player
node_player -->|"updates play counts"| node_guild_data
node_player -->|"records track plays"| node_play_stats
node_admin_config -.->|"configures guild"| node_guild_data
node_guild_events -.->|"handles guild lifecycle"| node_guild_data
node_modlogs -->|"reads log settings"| node_guild_data
node_help -->|"lists command metadata"| node_commands

click node_entry "https://github.com/bonee4/ayume/blob/master/src/Client.ts"
click node_client "https://github.com/bonee4/ayume/blob/master/src/structures/AyumeClient.ts"
click node_utils "https://github.com/bonee4/ayume/blob/master/src/structures/Utils.ts"
click node_interactions "https://github.com/bonee4/ayume/blob/master/src/events/interactionCreate.ts"
click node_commands "https://github.com/bonee4/ayume/blob/master/src/structures/Command.ts"
click node_events "https://github.com/bonee4/ayume/blob/master/src/structures/Event.ts"
click node_logger "https://github.com/bonee4/ayume/blob/master/src/others/Logger.ts"
click node_music_commands "https://github.com/bonee4/ayume/tree/master/src/commands/m%C3%BAsica"
click node_dj_commands "https://github.com/bonee4/ayume/tree/master/src/commands/dj"
click node_player "https://github.com/bonee4/ayume/blob/master/src/lavalink/index.ts"
click node_play_stats "https://github.com/bonee4/ayume/blob/master/src/lavalink/index.ts"
click node_playlists "https://github.com/bonee4/ayume/tree/master/src/commands/playlists"
click node_admin_config "https://github.com/bonee4/ayume/tree/master/src/commands/administrador"
click node_guild_events "https://github.com/bonee4/ayume/tree/master/src/events/guildEvents"
click node_modlogs "https://github.com/bonee4/ayume/tree/master/src/events/modLogs"
click node_guild_data "https://github.com/bonee4/ayume/blob/master/src/structures/AyumeClient.ts"
click node_help "https://github.com/bonee4/ayume/blob/master/src/commands/utilitarios/help.ts"
click node_utility_commands "https://github.com/bonee4/ayume/tree/master/src/commands/utilitarios"
click node_developer "https://github.com/bonee4/ayume/blob/master/src/commands/desenvolvedor/eval.ts"

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_entry,node_client,node_utils,node_interactions,node_commands,node_events,node_logger,node_discord toneBlue
class node_music_commands,node_dj_commands,node_player,node_play_stats,node_playlists toneAmber
class node_admin_config,node_guild_events,node_modlogs,node_guild_data toneMint
class node_help,node_utility_commands,node_developer toneRose
```

## Components

### Bot Runtime

- [Client entry](https://github.com/bonee4/ayume/blob/master/src/Client.ts): `src/Client.ts`
- [Bot client](https://github.com/bonee4/ayume/blob/master/src/structures/AyumeClient.ts): `src/structures/AyumeClient.ts`
- [Runtime utilities](https://github.com/bonee4/ayume/blob/master/src/structures/Utils.ts): `src/structures/Utils.ts`
- [Interaction dispatch](https://github.com/bonee4/ayume/blob/master/src/events/interactionCreate.ts): `src/events/interactionCreate.ts`
- [Command framework](https://github.com/bonee4/ayume/blob/master/src/structures/Command.ts): `src/structures/Command.ts`
- [Event framework](https://github.com/bonee4/ayume/blob/master/src/structures/Event.ts): `src/structures/Event.ts`
- [Logging](https://github.com/bonee4/ayume/blob/master/src/others/Logger.ts): `src/others/Logger.ts`

### Music Playback

- [Music commands](https://github.com/bonee4/ayume/tree/master/src/commands/m%C3%BAsica): `src/commands/música`
- [DJ controls](https://github.com/bonee4/ayume/tree/master/src/commands/dj): `src/commands/dj`
- [Lavalink player](https://github.com/bonee4/ayume/blob/master/src/lavalink/index.ts): `src/lavalink/index.ts`
- [Playback statistics](https://github.com/bonee4/ayume/blob/master/src/lavalink/index.ts): `src/lavalink/index.ts`
- [Playlist commands](https://github.com/bonee4/ayume/tree/master/src/commands/playlists): `src/commands/playlists`

### Guild Features

- [Server configuration](https://github.com/bonee4/ayume/tree/master/src/commands/administrador): `src/commands/administrador`
- [Guild lifecycle](https://github.com/bonee4/ayume/tree/master/src/events/guildEvents): `src/events/guildEvents`
- [Moderation logs](https://github.com/bonee4/ayume/tree/master/src/events/modLogs): `src/events/modLogs`
- [Guild and user data](https://github.com/bonee4/ayume/blob/master/src/structures/AyumeClient.ts): `src/structures/AyumeClient.ts`

### User Support

- [Help command](https://github.com/bonee4/ayume/blob/master/src/commands/utilitarios/help.ts): `src/commands/utilitarios/help.ts`
- [Utility commands](https://github.com/bonee4/ayume/tree/master/src/commands/utilitarios): `src/commands/utilitarios`
- [Developer command](https://github.com/bonee4/ayume/blob/master/src/commands/desenvolvedor/eval.ts): `src/commands/desenvolvedor/eval.ts`

### Other components

- **Discord users**

## Connections

- Discord users → Client entry: starts bot (evidence: `src/Client.ts`)
- Client entry → Bot client: creates client (evidence: `src/Client.ts`)
- Bot client → Runtime utilities: constructs (evidence: `src/structures/AyumeClient.ts`)
- Bot client → Lavalink player: constructs (evidence: `src/structures/AyumeClient.ts`)
- Bot client → Command framework: stores commands (evidence: `src/structures/AyumeClient.ts`)
- Bot client → Event framework: stores events (evidence: `src/structures/AyumeClient.ts`)
- Bot client → Guild and user data: creates database client (evidence: `src/structures/AyumeClient.ts`)
- Bot client → Runtime utilities: loads on start (evidence: `src/structures/AyumeClient.ts`)
- Runtime utilities → Command framework: loads command classes (evidence: `src/structures/Utils.ts`)
- Runtime utilities → Event framework: loads event classes (evidence: `src/structures/Utils.ts`)
- Discord users → Interaction dispatch: sends interactions
- Interaction dispatch → Command framework: looks up and runs (evidence: `src/events/interactionCreate.ts`)
- Interaction dispatch → Guild and user data: reads and initializes (evidence: `src/events/interactionCreate.ts`)
- Command framework → Music commands: dispatches to (evidence: `src/commands/música/search.ts`)
- Command framework → DJ controls: dispatches to (evidence: `src/commands/dj/moveTrack.ts`)
- Command framework → Playlist commands: dispatches to (evidence: `src/commands/playlists/playlist.ts`)
- Command framework → Server configuration: dispatches to (evidence: `src/commands/administrador/config.ts`)
- Command framework → Help command: dispatches to (evidence: `src/commands/utilitarios/help.ts`)
- Command framework → Utility commands: dispatches to (evidence: `src/commands/utilitarios/help.ts`)
- Command framework → Developer command: dispatches to (evidence: `src/commands/desenvolvedor/eval.ts`)
- Music commands → Lavalink player: searches and queues (evidence: `src/commands/música/search.ts`)
- Music commands → Runtime utilities: formats duration (evidence: `src/commands/música/search.ts`)
- DJ controls → Lavalink player: controls playback
- Playlist commands → Lavalink player: uses playback
- Lavalink player → Guild and user data: updates play counts (evidence: `src/lavalink/index.ts`)
- Lavalink player → Playback statistics: records track plays (evidence: `src/lavalink/index.ts`)
- Server configuration → Guild and user data: configures guild (evidence: `src/commands/administrador/config.ts`)
- Guild lifecycle → Guild and user data: handles guild lifecycle (evidence: `src/events/guildEvents/guildDelete.ts`)
- Moderation logs → Guild and user data: reads log settings (evidence: `src/events/modLogs/messageUpdate.ts`)
- Help command → Command framework: lists command metadata (evidence: `src/commands/utilitarios/help.ts`)
