# hacty/cubito-v13 architecture

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

- Interactive diagram: https://gitdiagram.com/hacty/cubito-v13
- Repository: https://github.com/hacty/cubito-v13

## Overview

This is a Discord bot offering server utilities and moderation, economy and Minecraft-style gameplay, music playback, leveling, social features, and slash commands. The principal workflow is a member issuing a command, the bot dispatching it, command logic optionally reading or updating guild/user state or invoking an integration, then replying in Discord. The excerpts show selected command-to-storage and music relationships; many command and event links are not sampled, so those are omitted rather than inferred.

Main entry points: [`index.js`](https://github.com/hacty/cubito-v13/blob/bots/index.js) (Bot entrypoint), [`bot/messageCreate/prefix.js`](https://github.com/hacty/cubito-v13/blob/bots/bot/messageCreate/prefix.js) (Prefix commands), [`comandos/moderacion`](https://github.com/hacty/cubito-v13/tree/bots/comandos/moderacion) (Moderation commands), [`comandos/economia`](https://github.com/hacty/cubito-v13/tree/bots/comandos/economia) (Economy commands)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_entry["Bot entrypoint<br/>[index.js]"]
  node_config["Bot configuration<br/>[config.js]"]
  node_dbconnect["Database connection<br/>[conexion.js]"]
  node_prefixdispatch["Prefix commands<br/>[prefix.js]"]
  node_slashdispatch["Slash commands<br/>[slashes.js]"]
end

subgraph group_commands["Command features"]
  node_utility["Utility commands"]
  node_moderation["Moderation commands"]
  node_economy["Economy commands"]
  node_minecraft["Minecraft commands"]
  node_levelcommands["Level commands"]
  node_ownercommands["Owner commands"]
end

subgraph group_state["Persistent state"]
  node_economydata[("Economy state<br/>[economia-schema.js]")]
  node_mutedata[("Mute settings<br/>[mute.js]")]
  node_warndata[("Warning records<br/>[warns.js]")]
  node_leveldata[("Level records<br/>[levels.js]")]
  node_suggestions[("Suggestion records")]
  node_votes[("Vote records<br/>[VotosSchema.js]")]
  node_guildconfig[("Guild configuration<br/>[guildconfigs.js]")]
end

subgraph group_media["Media and games"]
  node_music["Music queue and playback<br/>[music.js]"]
  node_akinator["Akinator game<br/>[akinator.js]"]
  node_fun["Entertainment commands"]
end

subgraph group_guild["Guild services"]
  node_welcome["Welcome handler<br/>[bienvenida.js]"]
  node_guildsetup["Guild setup<br/>[setups.js]"]
  node_events["Guild event handlers"]
  node_buttons["Button interactions<br/>[botones.js]"]
end

node_member(("Discord member"))
node_discord(("Discord platform"))

node_member -.->|"issues commands"| node_discord
node_discord -.->|"delivers events"| node_entry
node_entry -->|"loads"| node_config
node_entry -->|"loads"| node_dbconnect
node_entry -->|"imports"| node_guildconfig
node_entry -->|"updates"| node_leveldata
node_entry -->|"imports"| node_suggestions
node_entry -->|"imports"| node_votes
node_entry -->|"imports"| node_akinator
node_entry -->|"loads"| node_slashdispatch
node_member -.->|"invokes"| node_prefixdispatch
node_prefixdispatch -.->|"dispatches"| node_utility
node_prefixdispatch -.->|"dispatches"| node_moderation
node_prefixdispatch -.->|"dispatches"| node_economy
node_prefixdispatch -.->|"dispatches"| node_minecraft
node_prefixdispatch -.->|"dispatches"| node_levelcommands
node_prefixdispatch -.->|"dispatches"| node_fun
node_member -.->|"invokes"| node_slashdispatch
node_economy -->|"reads and updates"| node_economydata
node_minecraft -->|"reads and updates"| node_economydata
node_moderation -->|"reads"| node_mutedata
node_moderation -->|"uses"| node_warndata
node_levelcommands -->|"reads"| node_leveldata
node_music -.->|"plays audio"| node_discord
node_discord -.->|"returns replies"| node_member

click node_entry "https://github.com/hacty/cubito-v13/blob/bots/index.js"
click node_config "https://github.com/hacty/cubito-v13/blob/bots/config.js"
click node_dbconnect "https://github.com/hacty/cubito-v13/blob/bots/conexion.js"
click node_prefixdispatch "https://github.com/hacty/cubito-v13/blob/bots/bot/messageCreate/prefix.js"
click node_slashdispatch "https://github.com/hacty/cubito-v13/blob/bots/slashes.js"
click node_utility "https://github.com/hacty/cubito-v13/tree/bots/comandos/Utiles"
click node_moderation "https://github.com/hacty/cubito-v13/tree/bots/comandos/moderacion"
click node_economy "https://github.com/hacty/cubito-v13/tree/bots/comandos/economia"
click node_minecraft "https://github.com/hacty/cubito-v13/tree/bots/comandos/minecraft"
click node_levelcommands "https://github.com/hacty/cubito-v13/tree/bots/comandos/niveles"
click node_ownercommands "https://github.com/hacty/cubito-v13/tree/bots/comandos/owners"
click node_economydata "https://github.com/hacty/cubito-v13/blob/bots/Schema/economia-schema.js"
click node_mutedata "https://github.com/hacty/cubito-v13/blob/bots/Schema/mute.js"
click node_warndata "https://github.com/hacty/cubito-v13/blob/bots/Schema/warns.js"
click node_leveldata "https://github.com/hacty/cubito-v13/blob/bots/Schema/levels.js"
click node_suggestions "https://github.com/hacty/cubito-v13/blob/bots/Schema/SugerenciasSchema.js"
click node_votes "https://github.com/hacty/cubito-v13/blob/bots/Schema/VotosSchema.js"
click node_guildconfig "https://github.com/hacty/cubito-v13/blob/bots/Schema/guildconfigs.js"
click node_music "https://github.com/hacty/cubito-v13/blob/bots/global/music.js"
click node_akinator "https://github.com/hacty/cubito-v13/blob/bots/util/akinator.js"
click node_fun "https://github.com/hacty/cubito-v13/tree/bots/comandos/divercion"
click node_welcome "https://github.com/hacty/cubito-v13/blob/bots/handlers/bienvenida.js"
click node_guildsetup "https://github.com/hacty/cubito-v13/blob/bots/modelos/setups.js"
click node_events "https://github.com/hacty/cubito-v13/tree/bots/eventos/guild"
click node_buttons "https://github.com/hacty/cubito-v13/blob/bots/otros/botones.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_entry,node_config,node_dbconnect,node_prefixdispatch,node_slashdispatch toneBlue
class node_utility,node_moderation,node_economy,node_minecraft,node_levelcommands,node_ownercommands toneAmber
class node_economydata,node_mutedata,node_warndata,node_leveldata,node_suggestions,node_votes,node_guildconfig toneMint
class node_music,node_akinator,node_fun toneRose
class node_welcome,node_guildsetup,node_events,node_buttons,node_member,node_discord toneIndigo
```

## Components

### Bot runtime

- [Bot entrypoint](https://github.com/hacty/cubito-v13/blob/bots/index.js): `index.js`
- [Bot configuration](https://github.com/hacty/cubito-v13/blob/bots/config.js): `config.js`
- [Database connection](https://github.com/hacty/cubito-v13/blob/bots/conexion.js): `conexion.js`
- [Prefix commands](https://github.com/hacty/cubito-v13/blob/bots/bot/messageCreate/prefix.js): `bot/messageCreate/prefix.js`
- [Slash commands](https://github.com/hacty/cubito-v13/blob/bots/slashes.js): `slashes.js`

### Command features

- [Utility commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/Utiles): `comandos/Utiles`
- [Moderation commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/moderacion): `comandos/moderacion`
- [Economy commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/economia): `comandos/economia`
- [Minecraft commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/minecraft): `comandos/minecraft`
- [Level commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/niveles): `comandos/niveles`
- [Owner commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/owners): `comandos/owners`

### Persistent state

- [Economy state](https://github.com/hacty/cubito-v13/blob/bots/Schema/economia-schema.js): `Schema/economia-schema.js`
- [Mute settings](https://github.com/hacty/cubito-v13/blob/bots/Schema/mute.js): `Schema/mute.js`
- [Warning records](https://github.com/hacty/cubito-v13/blob/bots/Schema/warns.js): `Schema/warns.js`
- [Level records](https://github.com/hacty/cubito-v13/blob/bots/Schema/levels.js): `Schema/levels.js`
- [Suggestion records](https://github.com/hacty/cubito-v13/blob/bots/Schema/SugerenciasSchema.js): `Schema/SugerenciasSchema.js`
- [Vote records](https://github.com/hacty/cubito-v13/blob/bots/Schema/VotosSchema.js): `Schema/VotosSchema.js`
- [Guild configuration](https://github.com/hacty/cubito-v13/blob/bots/Schema/guildconfigs.js): `Schema/guildconfigs.js`

### Media and games

- [Music queue and playback](https://github.com/hacty/cubito-v13/blob/bots/global/music.js): `global/music.js`
- [Akinator game](https://github.com/hacty/cubito-v13/blob/bots/util/akinator.js): `util/akinator.js`
- [Entertainment commands](https://github.com/hacty/cubito-v13/tree/bots/comandos/divercion): `comandos/divercion`

### Guild services

- [Welcome handler](https://github.com/hacty/cubito-v13/blob/bots/handlers/bienvenida.js): `handlers/bienvenida.js`
- [Guild setup](https://github.com/hacty/cubito-v13/blob/bots/modelos/setups.js): `modelos/setups.js`
- [Guild event handlers](https://github.com/hacty/cubito-v13/tree/bots/eventos/guild): `eventos/guild`
- [Button interactions](https://github.com/hacty/cubito-v13/blob/bots/otros/botones.js): `otros/botones.js`

### Other components

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

## Connections

- Discord member → Discord platform: issues commands
- Discord platform → Bot entrypoint: delivers events
- Bot entrypoint → Bot configuration: loads (evidence: `index.js`)
- Bot entrypoint → Database connection: loads (evidence: `index.js`)
- Bot entrypoint → Guild configuration: imports (evidence: `index.js`)
- Bot entrypoint → Level records: updates (evidence: `index.js`)
- Bot entrypoint → Suggestion records: imports (evidence: `index.js`)
- Bot entrypoint → Vote records: imports (evidence: `index.js`)
- Bot entrypoint → Akinator game: imports (evidence: `index.js`)
- Bot entrypoint → Slash commands: loads (evidence: `index.js`)
- Discord member → Prefix commands: invokes
- Prefix commands → Utility commands: dispatches
- Prefix commands → Moderation commands: dispatches
- Prefix commands → Economy commands: dispatches
- Prefix commands → Minecraft commands: dispatches
- Prefix commands → Level commands: dispatches
- Prefix commands → Entertainment commands: dispatches
- Discord member → Slash commands: invokes
- Economy commands → Economy state: reads and updates (evidence: `comandos/economia/buy.js`)
- Minecraft commands → Economy state: reads and updates (evidence: `comandos/minecraft/craft.js`)
- Moderation commands → Mute settings: reads (evidence: `comandos/moderacion/mute.js`)
- Moderation commands → Warning records: uses (evidence: `comandos/moderacion/warn.js`)
- Level commands → Level records: reads (evidence: `comandos/niveles/rank.js`)
- Music queue and playback → Discord platform: plays audio
- Discord platform → Discord member: returns replies
