# wezlem/luminasubs-bot architecture

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

- Interactive diagram: https://gitdiagram.com/wezlem/luminasubs-bot
- Repository: https://github.com/wezlem/luminasubs-bot

## Overview

LuminaSubs is a Discord bot for publishing anime episode announcements. A user runs the announcement command, supplies episode details and release links in a modal, and the bot enriches the announcement with anime metadata before posting an embed with link buttons and an optional role mention. The command temporarily saves contributor selections for the modal handler. Anime lookup prefers Jikan, then falls back to AniList and Kitsu. Source excerpts show the handlers and helpers, but not Discord’s internal delivery behavior.

Main entry points: [`events/interactionCreate.js`](https://github.com/wezlem/luminasubs-bot/blob/main/events/interactionCreate.js) (Interaction handler), [`utils/mal.js`](https://github.com/wezlem/luminasubs-bot/blob/main/utils/mal.js) (Anime lookup), [`commands/bolumbildirimi.js`](https://github.com/wezlem/luminasubs-bot/blob/main/commands/bolumbildirimi.js) (Episode command), [`index.js`](https://github.com/wezlem/luminasubs-bot/blob/main/index.js) (Bot runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_bot["Discord bot"]
  node_runtime["Bot runtime<br/>[index.js]"]
  node_interactions["Interaction handler"]
  node_ready["Ready handler<br/>[ready.js]"]
  node_presence["Presence helper<br/>[presence.js]"]
end

subgraph group_workflow["Announcement workflow"]
  node_command["Episode command<br/>[bolumbildirimi.js]"]
  node_pending[("Pending team data<br/>[pendingData.js]")]
  node_links["Link parser<br/>[parseLinks.js]"]
  node_presentation["Embed and buttons<br/>[embed.js]"]
end

subgraph group_metadata["Anime metadata"]
  node_mal["Anime lookup<br/>[mal.js]"]
end

node_user(("Discord user"))
node_discord["Discord platform"]
node_jikan["Jikan API"]
node_anilist["AniList API"]
node_kitsu["Kitsu API"]

node_runtime -->|"registers handler"| node_interactions
node_runtime -->|"registers handler"| node_ready
node_interactions -->|"dispatches command"| node_command
node_user -->|"submits command"| node_discord
node_discord -->|"delivers interaction"| node_interactions
node_command -->|"stores team data"| node_pending
node_command -->|"opens modal"| node_discord
node_user -->|"submits modal"| node_discord
node_interactions -->|"reads and deletes"| node_pending
node_interactions -->|"requests anime info"| node_mal
node_mal -->|"requests metadata"| node_jikan
node_mal -.->|"fallback lookup"| node_anilist
node_mal -.->|"fallback lookup"| node_kitsu
node_kitsu -->|"looks up studio"| node_kitsu
node_interactions -->|"parses release links"| node_links
node_interactions -->|"builds announcement"| node_presentation
node_interactions -->|"posts announcement"| node_discord
node_ready -->|"sets presence"| node_presence
node_presence -->|"updates presence"| node_discord

click node_runtime "https://github.com/wezlem/luminasubs-bot/blob/main/index.js"
click node_interactions "https://github.com/wezlem/luminasubs-bot/blob/main/events/interactionCreate.js"
click node_ready "https://github.com/wezlem/luminasubs-bot/blob/main/events/ready.js"
click node_presence "https://github.com/wezlem/luminasubs-bot/blob/main/utils/presence.js"
click node_command "https://github.com/wezlem/luminasubs-bot/blob/main/commands/bolumbildirimi.js"
click node_pending "https://github.com/wezlem/luminasubs-bot/blob/main/utils/pendingData.js"
click node_links "https://github.com/wezlem/luminasubs-bot/blob/main/utils/parseLinks.js"
click node_presentation "https://github.com/wezlem/luminasubs-bot/blob/main/utils/embed.js"
click node_mal "https://github.com/wezlem/luminasubs-bot/blob/main/utils/mal.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_runtime,node_interactions,node_ready,node_presence,node_user toneBlue
class node_command,node_pending,node_links,node_presentation toneAmber
class node_mal,node_jikan,node_anilist,node_kitsu toneMint
class node_discord toneIndigo
```

## Components

### Discord bot

- [Bot runtime](https://github.com/wezlem/luminasubs-bot/blob/main/index.js): `index.js`
- [Interaction handler](https://github.com/wezlem/luminasubs-bot/blob/main/events/interactionCreate.js): `events/interactionCreate.js`
- [Ready handler](https://github.com/wezlem/luminasubs-bot/blob/main/events/ready.js): `events/ready.js`
- [Presence helper](https://github.com/wezlem/luminasubs-bot/blob/main/utils/presence.js): `utils/presence.js`

### Announcement workflow

- [Episode command](https://github.com/wezlem/luminasubs-bot/blob/main/commands/bolumbildirimi.js): `commands/bolumbildirimi.js`
- [Pending team data](https://github.com/wezlem/luminasubs-bot/blob/main/utils/pendingData.js): `utils/pendingData.js`
- [Link parser](https://github.com/wezlem/luminasubs-bot/blob/main/utils/parseLinks.js): `utils/parseLinks.js`
- [Embed and buttons](https://github.com/wezlem/luminasubs-bot/blob/main/utils/embed.js): `utils/embed.js`

### Anime metadata

- [Anime lookup](https://github.com/wezlem/luminasubs-bot/blob/main/utils/mal.js): `utils/mal.js`

### Other components

- **Discord user**
- **Discord platform**
- **Jikan API**
- **AniList API**
- **Kitsu API**

## Connections

- Bot runtime → Interaction handler: registers handler
- Bot runtime → Ready handler: registers handler
- Interaction handler → Episode command: dispatches command
- Discord user → Discord platform: submits command
- Discord platform → Interaction handler: delivers interaction
- Episode command → Pending team data: stores team data
- Episode command → Discord platform: opens modal
- Discord user → Discord platform: submits modal
- Interaction handler → Pending team data: reads and deletes
- Interaction handler → Anime lookup: requests anime info
- Anime lookup → Jikan API: requests metadata
- Anime lookup → AniList API: fallback lookup
- Anime lookup → Kitsu API: fallback lookup
- Kitsu API → Kitsu API: looks up studio
- Interaction handler → Link parser: parses release links
- Interaction handler → Embed and buttons: builds announcement
- Interaction handler → Discord platform: posts announcement
- Ready handler → Presence helper: sets presence
- Presence helper → Discord platform: updates presence
