# quentin-v/enigma-discord architecture

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

- Interactive diagram: https://gitdiagram.com/quentin-v/enigma-discord
- Repository: https://github.com/quentin-v/enigma-discord

## Overview

##### Project type and purpose
- This is an open-source Discord bot (Node.js) named “enigma-discord.”
- Purpose: replicate the “Enigma” functionality (from quinta.ovh/enigma) inside Discord, adding one or two extra processing steps.
- Primary user interactions happen via Discord messages/commands; the bot responds with embedded messages and audio resources.

##### File structure
Top-level files:
– bot.js          : Entry point. Sets up the Discord client, registers event handlers.
– embeds.js       : Encapsulates logic for building rich embed messages.
– package.json    : Lists dependencies (e.g., discord.js) and scripts.
– package-lock.json: Exact dependency tree.
– .gitignore      : Excludes node_modules, logs, etc.
resources/ directory:
– bipbipboup.wav, piano.wav : Audio assets used by the bot.
– js/                    : Possible client-side JS snippets or helper scripts.

##### README for additional insights
- Short project description: “Bot for Enigma” with extra steps.
– Interaction with Discord API.
– Use of audio assets.
– Generation of embed messages for UI.

##### Detailed callouts
- How the bot’s event handler in bot.js delegates to embeds.js.

## Diagram (Mermaid)

```mermaid
flowchart TD
    subgraph "External Components"
        User["Discord User"]:::external
        API["Discord Gateway/API"]:::external
    end

    subgraph "Core Application"
        BotCore["Bot Core (bot.js)"]:::core
        EmbedBuilder["Embed Builder (embeds.js)"]:::core
        subgraph "Audio Resources"
            Bipbipboup["Bipbipboup.wav"]:::resource
            Piano["Piano.wav"]:::resource
        end
    end

    subgraph "Development Tools"
        npm["npm (package.json, package-lock.json)"]:::dev
        Gitignore[".gitignore"]:::dev
        README["README.md"]:::dev
        Helpers["JS Helpers (resources/js/)"]:::resource
    end

    User -->|"message.create event"| API
    API -->|"event payload"| BotCore
    BotCore -->|"construct embed"| EmbedBuilder
    BotCore -->|"load audio"| Bipbipboup
    BotCore -->|"load audio"| Piano
    BotCore -->|"use helpers"| Helpers
    BotCore -->|"send RichEmbed payload"| API
    BotCore -->|"send audio attachment"| API
    npm -.->|"install & run"| BotCore
    npm -.->|"define scripts & deps"| EmbedBuilder

    click BotCore "https://github.com/quentin-v/enigma-discord/blob/master/bot.js"
    click EmbedBuilder "https://github.com/quentin-v/enigma-discord/blob/master/embeds.js"
    click Bipbipboup "https://github.com/quentin-v/enigma-discord/blob/master/resources/bipbipboup.wav"
    click Piano "https://github.com/quentin-v/enigma-discord/blob/master/resources/piano.wav"
    click Helpers "https://github.com/quentin-v/enigma-discord/tree/master/resources/js/"
    click PackageJSON "https://github.com/quentin-v/enigma-discord/blob/master/package.json"
    click PackageLock "https://github.com/quentin-v/enigma-discord/blob/master/package-lock.json"
    click Gitignore "https://github.com/quentin-v/enigma-discord/blob/master/.gitignore"
    click README "https://github.com/quentin-v/enigma-discord/blob/master/README.md"

    classDef external fill:#D0E6FF,stroke:#4A90E2,color:#000;
    classDef core fill:#DFF5D0,stroke:#3B8731,color:#000;
    classDef resource fill:#FFE5B4,stroke:#E69500,color:#000;
    classDef dev fill:#F5F5F5,stroke:#CCCCCC,color:#000,stroke-dasharray: 5 5;
```
