# developer-land/mm-utilities architecture

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

- Interactive diagram: https://gitdiagram.com/developer-land/mm-utilities
- Repository: https://github.com/developer-land/mm-utilities

## Overview

MM-Utilities is a Discord bot for the MM Gamer community. Members interact through slash commands and message components; the bot provides community utilities, ticketing, suggestions, self-roles, leveling and music. Its client dynamically loads handlers and routes Discord interactions, while Mongoose models hold ticket, leveling and other feature state. The README also lists a YouTube feed, but its implementation and wiring were not sampled, so that capability is shown without an asserted internal call path. Some feature links are documented capabilities rather than inspected handler calls.

Main entry points: [`src/Structures/Client.ts`](https://github.com/developer-land/mm-utilities/blob/main/src/Structures/Client.ts) (Extended client), [`src/Events/Bot/interactionCreate.ts`](https://github.com/developer-land/mm-utilities/blob/main/src/Events/Bot/interactionCreate.ts) (Interaction router), [`src/Commands/Music/music.ts`](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Music/music.ts) (Music commands), [`src/Commands/Staff/leveling.ts`](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Staff/leveling.ts) (Leveling and ranks)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_client["Extended client<br/>[Client.ts]"]
  node_entry["Bot entry point<br/>[index.ts]"]
  node_interaction["Interaction router"]
  node_commands["Slash commands"]
  node_buttons["Button handlers"]
end

subgraph group_community["Community features"]
  node_leveling["Leveling and ranks<br/>[leveling.ts]"]
  node_roles["Self roles<br/>[buttonrole.ts]"]
  node_afk["AFK utilities<br/>[afk.ts]"]
  node_info["Info commands"]
  node_youtube["YouTube feed"]
end

subgraph group_support["Support workflows"]
  node_tickets["Ticket workflow"]
  node_suggestions["Suggestions<br/>[suggestions.ts]"]
  node_reports["Reports and appeals<br/>[report.ts]"]
end

subgraph group_music["Music playback"]
  node_musiccmd["Music commands<br/>[music.ts]"]
  node_player["Extended player<br/>[ExtendedPlayer.ts]"]
  node_lavalink["Lavalink system<br/>[lavalink.ts]"]
end

subgraph group_state["Persistence"]
  node_models[("Mongoose models")]
  node_ticketmodel[("Ticket records<br/>[ticket.ts]")]
  node_levelmodels[("Leveling records")]
  node_suggestionmodel[("Suggestion records<br/>[suggestion.ts]")]
end

node_member(("Discord member"))
node_discord{{"Discord platform"}}
node_mongo[("MongoDB")]

node_member -->|"uses"| node_discord
node_discord -->|"sends interactions"| node_interaction
node_entry -->|"starts"| node_client
node_client -->|"loads handlers"| node_commands
node_client -->|"loads handlers"| node_buttons
node_interaction -->|"dispatches commands"| node_commands
node_interaction -->|"dispatches buttons"| node_buttons
node_member -->|"uses"| node_leveling
node_member -->|"uses"| node_roles
node_member -->|"uses"| node_afk
node_member -->|"requests information"| node_info
node_member -.->|"receives feed"| node_youtube
node_member -->|"opens and manages"| node_tickets
node_member -->|"submits"| node_suggestions
node_member -->|"submits"| node_reports
node_member -->|"requests playback"| node_musiccmd
node_musiccmd -->|"uses"| node_player
node_musiccmd -->|"controls playback"| node_lavalink
node_lavalink -->|"sends voice payloads"| node_discord
node_client -->|"connects"| node_mongo
node_models -.->|"stores documents"| node_mongo
node_tickets -->|"reads and writes"| node_ticketmodel
node_leveling -->|"uses"| node_levelmodels
node_suggestions -.->|"persists suggestions"| node_suggestionmodel

click node_client "https://github.com/developer-land/mm-utilities/blob/main/src/Structures/Client.ts"
click node_entry "https://github.com/developer-land/mm-utilities/blob/main/src/index.ts"
click node_interaction "https://github.com/developer-land/mm-utilities/blob/main/src/Events/Bot/interactionCreate.ts"
click node_commands "https://github.com/developer-land/mm-utilities/tree/main/src/Commands"
click node_buttons "https://github.com/developer-land/mm-utilities/tree/main/src/Buttons"
click node_leveling "https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Staff/leveling.ts"
click node_roles "https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Staff/buttonrole.ts"
click node_afk "https://github.com/developer-land/mm-utilities/blob/main/src/Models/Go/afk.ts"
click node_info "https://github.com/developer-land/mm-utilities/tree/main/src/Commands/Info"
click node_youtube "https://github.com/developer-land/mm-utilities/tree/main/src/Events"
click node_tickets "https://github.com/developer-land/mm-utilities/tree/main/src/Buttons/Ticket"
click node_suggestions "https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Utilities/suggestions.ts"
click node_reports "https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Utilities/report.ts"
click node_musiccmd "https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Music/music.ts"
click node_player "https://github.com/developer-land/mm-utilities/blob/main/src/Structures/ExtendedPlayer.ts"
click node_lavalink "https://github.com/developer-land/mm-utilities/blob/main/src/Systems/lavalink.ts"
click node_models "https://github.com/developer-land/mm-utilities/tree/main/src/Models"
click node_ticketmodel "https://github.com/developer-land/mm-utilities/blob/main/src/Models/Ticket/ticket.ts"
click node_levelmodels "https://github.com/developer-land/mm-utilities/tree/main/src/Models/Leveling"
click node_suggestionmodel "https://github.com/developer-land/mm-utilities/blob/main/src/Models/Suggestion/suggestion.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_client,node_entry,node_interaction,node_commands,node_buttons toneBlue
class node_leveling,node_roles,node_afk,node_info,node_youtube,node_mongo toneAmber
class node_tickets,node_suggestions,node_reports toneMint
class node_musiccmd,node_player,node_lavalink toneRose
class node_models,node_ticketmodel,node_levelmodels,node_suggestionmodel,node_member,node_discord toneIndigo
```

## Components

### Bot runtime

- [Extended client](https://github.com/developer-land/mm-utilities/blob/main/src/Structures/Client.ts): `src/Structures/Client.ts`
- [Bot entry point](https://github.com/developer-land/mm-utilities/blob/main/src/index.ts): `src/index.ts`
- [Interaction router](https://github.com/developer-land/mm-utilities/blob/main/src/Events/Bot/interactionCreate.ts): `src/Events/Bot/interactionCreate.ts`
- [Slash commands](https://github.com/developer-land/mm-utilities/tree/main/src/Commands): `src/Commands`
- [Button handlers](https://github.com/developer-land/mm-utilities/tree/main/src/Buttons): `src/Buttons`

### Community features

- [Leveling and ranks](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Staff/leveling.ts): `src/Commands/Staff/leveling.ts`
- [Self roles](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Staff/buttonrole.ts): `src/Commands/Staff/buttonrole.ts`
- [AFK utilities](https://github.com/developer-land/mm-utilities/blob/main/src/Models/Go/afk.ts): `src/Models/Go/afk.ts`
- [Info commands](https://github.com/developer-land/mm-utilities/tree/main/src/Commands/Info): `src/Commands/Info`
- [YouTube feed](https://github.com/developer-land/mm-utilities/tree/main/src/Events): `src/Events`

### Support workflows

- [Ticket workflow](https://github.com/developer-land/mm-utilities/tree/main/src/Buttons/Ticket): `src/Buttons/Ticket`
- [Suggestions](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Utilities/suggestions.ts): `src/Commands/Utilities/suggestions.ts`
- [Reports and appeals](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Utilities/report.ts): `src/Commands/Utilities/report.ts`

### Music playback

- [Music commands](https://github.com/developer-land/mm-utilities/blob/main/src/Commands/Music/music.ts): `src/Commands/Music/music.ts`
- [Extended player](https://github.com/developer-land/mm-utilities/blob/main/src/Structures/ExtendedPlayer.ts): `src/Structures/ExtendedPlayer.ts`
- [Lavalink system](https://github.com/developer-land/mm-utilities/blob/main/src/Systems/lavalink.ts): `src/Systems/lavalink.ts`

### Persistence

- [Mongoose models](https://github.com/developer-land/mm-utilities/tree/main/src/Models): `src/Models`
- [Ticket records](https://github.com/developer-land/mm-utilities/blob/main/src/Models/Ticket/ticket.ts): `src/Models/Ticket/ticket.ts`
- [Leveling records](https://github.com/developer-land/mm-utilities/tree/main/src/Models/Leveling): `src/Models/Leveling`
- [Suggestion records](https://github.com/developer-land/mm-utilities/blob/main/src/Models/Suggestion/suggestion.ts): `src/Models/Suggestion/suggestion.ts`

### Other components

- **Discord member**
- **Discord platform**
- **MongoDB**

## Connections

- Discord member → Discord platform: uses
- Discord platform → Interaction router: sends interactions (evidence: `src/Events/Bot/interactionCreate.ts`)
- Bot entry point → Extended client: starts (evidence: `src/index.ts`)
- Extended client → Slash commands: loads handlers (evidence: `src/Structures/Client.ts`)
- Extended client → Button handlers: loads handlers (evidence: `src/Structures/Client.ts`)
- Interaction router → Slash commands: dispatches commands (evidence: `src/Events/Bot/interactionCreate.ts`)
- Interaction router → Button handlers: dispatches buttons (evidence: `src/Events/Bot/interactionCreate.ts`)
- Discord member → Leveling and ranks: uses
- Discord member → Self roles: uses
- Discord member → AFK utilities: uses
- Discord member → Info commands: requests information
- Discord member → YouTube feed: receives feed
- Discord member → Ticket workflow: opens and manages
- Discord member → Suggestions: submits
- Discord member → Reports and appeals: submits
- Discord member → Music commands: requests playback
- Music commands → Extended player: uses (evidence: `src/Commands/Music/music.ts`)
- Music commands → Lavalink system: controls playback (evidence: `src/Commands/Music/music.ts`)
- Lavalink system → Discord platform: sends voice payloads (evidence: `src/Systems/lavalink.ts`)
- Extended client → MongoDB: connects (evidence: `src/Structures/Client.ts`)
- Mongoose models → MongoDB: stores documents
- Ticket workflow → Ticket records: reads and writes (evidence: `src/Buttons/Ticket/create_ticket.ts`)
- Leveling and ranks → Leveling records: uses (evidence: `src/Commands/Staff/leveling.ts`)
- Suggestions → Suggestion records: persists suggestions
