# elite-du-bat-k/elitedubatk architecture

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

- Interactive diagram: https://gitdiagram.com/elite-du-bat-k/elitedubatk
- Repository: https://github.com/elite-du-bat-k/elitedubatk

## Overview

EliteDuBatK is a Discord server bot combining moderation, audit logging, message-history recovery, and StudySuite planning and homework features. The main user workflow is a Discord slash command: the bot dispatches it to a command, which may call StudySuite, format the result, and reply in Discord. Separate event listeners handle moderation and server changes, while services coordinate channel locks and cached-message persistence. The README documents these capabilities; several wiring details are not shown in the sampled source, so uncertain call edges are omitted.

Main entry points: [`src/main/java/fr/umontpellier/iut/discordbot/commands/study/StudyCommand.java`](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/StudyCommand.java) (Study commands), [`src/main/java/fr/umontpellier/iut/discordbot/studysuite/StudySuiteClient.java`](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/studysuite/StudySuiteClient.java) (StudySuite client), [`src/main/java/fr/umontpellier/iut/discordbot/commands/study/PlanningSubcommand.java`](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/PlanningSubcommand.java) (Planning command), [`src/main/java/fr/umontpellier/iut/discordbot/Bot.java`](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/Bot.java) (Bot runtime)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_startup["Bot runtime"]
  node_main["Application entry<br/>[Main.java]"]
  node_bot["Bot runtime<br/>[Bot.java]"]
  node_config["Configuration<br/>[ConfigLoader.java]"]
end

subgraph group_interaction["Discord interactions"]
  node_commands["Command registry"]
  node_slash["Slash dispatch"]
  node_lockcmd["Channel lock command<br/>[LockCommand.java]"]
end

subgraph group_events["Server events"]
  node_eventmanager["Event registry<br/>[EventManager.java]"]
  node_audit["Audit listeners"]
  node_messageevents["Message listeners"]
  node_honeypot["Honeypot listener"]
end

subgraph group_study["StudySuite features"]
  node_studycmd["Study commands<br/>[StudyCommand.java]"]
  node_planning["Planning command"]
  node_homework["Homework commands"]
  node_addhomework["Add homework"]
  node_studyclient["StudySuite client"]
  node_studyformat["Planning and homework formatting"]
end

subgraph group_state["State and services"]
  node_lockservice["Channel lock service"]
  node_msgcache["Message cache service"]
  node_repository["Message repository"]
  node_database[("SQLite database")]
end

node_member(("Discord member"))
node_discord(("Discord"))
node_studysuite(("StudySuite API"))

node_main -->|"starts"| node_bot
node_bot -->|"loads"| node_config
node_member -->|"uses"| node_discord
node_discord -->|"dispatches"| node_slash
node_slash -->|"dispatches"| node_studycmd
node_commands -->|"registers commands"| node_discord
node_studycmd -->|"routes"| node_planning
node_studycmd -->|"routes"| node_homework
node_studycmd -->|"routes"| node_addhomework
node_planning -->|"requests events"| node_studyclient
node_homework -->|"requests assignments"| node_studyclient
node_addhomework -->|"creates assignment"| node_studyclient
node_studyclient -->|"calls API"| node_studysuite
node_planning -->|"formats schedule"| node_studyformat
node_studycmd -->|"replies"| node_discord
node_discord -->|"dispatches events"| node_eventmanager
node_eventmanager -->|"registers listeners"| node_discord
node_discord -->|"provides audit events"| node_audit
node_discord -->|"provides message events"| node_messageevents
node_discord -->|"provides messages"| node_honeypot
node_lockcmd -->|"changes lock"| node_lockservice
node_lockservice -->|"updates permissions"| node_discord
node_msgcache -->|"loads and writes"| node_repository
node_repository -->|"queries"| node_database

click node_main "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/Main.java"
click node_bot "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/Bot.java"
click node_commands "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/CommandManager.java"
click node_slash "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/SlashCommandEventListener.java"
click node_studycmd "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/StudyCommand.java"
click node_planning "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/PlanningSubcommand.java"
click node_homework "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/HomeworkSubcommand.java"
click node_addhomework "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/AddHomeworkSubcommand.java"
click node_studyclient "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/studysuite/StudySuiteClient.java"
click node_studyformat "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/studysuite/PlanningFormatter.java"
click node_eventmanager "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/EventManager.java"
click node_audit "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/audit/AbstractAuditLogListener.java"
click node_messageevents "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/messages/MessageDeleteListener.java"
click node_honeypot "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/HoneypotListener.java"
click node_lockcmd "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/LockCommand.java"
click node_lockservice "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/services/ChannelLockService.java"
click node_msgcache "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/services/MessageCacheService.java"
click node_repository "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/database/repositories/CachedMessageRepository.java"
click node_database "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/database/DatabaseConnection.java"
click node_config "https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/config/ConfigLoader.java"

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_main,node_bot,node_config toneBlue
class node_commands,node_slash,node_lockcmd toneAmber
class node_eventmanager,node_audit,node_messageevents,node_honeypot,node_studysuite toneMint
class node_studycmd,node_planning,node_homework,node_addhomework,node_studyclient,node_studyformat toneRose
class node_lockservice,node_msgcache,node_repository,node_database,node_member,node_discord toneIndigo
```

## Components

### Bot runtime

- [Application entry](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/Main.java): `src/main/java/fr/umontpellier/iut/discordbot/Main.java`
- [Bot runtime](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/Bot.java): `src/main/java/fr/umontpellier/iut/discordbot/Bot.java`
- [Configuration](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/config/ConfigLoader.java): `src/main/java/fr/umontpellier/iut/discordbot/config/ConfigLoader.java`

### Discord interactions

- [Command registry](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/CommandManager.java): `src/main/java/fr/umontpellier/iut/discordbot/commands/CommandManager.java`
- [Slash dispatch](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/SlashCommandEventListener.java): `src/main/java/fr/umontpellier/iut/discordbot/events/SlashCommandEventListener.java`
- [Channel lock command](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/LockCommand.java): `src/main/java/fr/umontpellier/iut/discordbot/commands/LockCommand.java`

### Server events

- [Event registry](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/EventManager.java): `src/main/java/fr/umontpellier/iut/discordbot/events/EventManager.java`
- [Audit listeners](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/audit/AbstractAuditLogListener.java): `src/main/java/fr/umontpellier/iut/discordbot/events/audit/AbstractAuditLogListener.java`
- [Message listeners](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/messages/MessageDeleteListener.java): `src/main/java/fr/umontpellier/iut/discordbot/events/messages/MessageDeleteListener.java`
- [Honeypot listener](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/events/HoneypotListener.java): `src/main/java/fr/umontpellier/iut/discordbot/events/HoneypotListener.java`

### StudySuite features

- [Study commands](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/StudyCommand.java): `src/main/java/fr/umontpellier/iut/discordbot/commands/study/StudyCommand.java`
- [Planning command](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/PlanningSubcommand.java): `src/main/java/fr/umontpellier/iut/discordbot/commands/study/PlanningSubcommand.java`
- [Homework commands](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/HomeworkSubcommand.java): `src/main/java/fr/umontpellier/iut/discordbot/commands/study/HomeworkSubcommand.java`
- [Add homework](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/commands/study/AddHomeworkSubcommand.java): `src/main/java/fr/umontpellier/iut/discordbot/commands/study/AddHomeworkSubcommand.java`
- [StudySuite client](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/studysuite/StudySuiteClient.java): `src/main/java/fr/umontpellier/iut/discordbot/studysuite/StudySuiteClient.java`
- [Planning and homework formatting](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/studysuite/PlanningFormatter.java): `src/main/java/fr/umontpellier/iut/discordbot/studysuite/PlanningFormatter.java`

### State and services

- [Channel lock service](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/services/ChannelLockService.java): `src/main/java/fr/umontpellier/iut/discordbot/services/ChannelLockService.java`
- [Message cache service](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/services/MessageCacheService.java): `src/main/java/fr/umontpellier/iut/discordbot/services/MessageCacheService.java`
- [Message repository](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/database/repositories/CachedMessageRepository.java): `src/main/java/fr/umontpellier/iut/discordbot/database/repositories/CachedMessageRepository.java`
- [SQLite database](https://github.com/elite-du-bat-k/elitedubatk/blob/main/src/main/java/fr/umontpellier/iut/discordbot/database/DatabaseConnection.java): `src/main/java/fr/umontpellier/iut/discordbot/database/DatabaseConnection.java`

### Other components

- **Discord member**
- **Discord**
- **StudySuite API**

## Connections

- Application entry → Bot runtime: starts
- Bot runtime → Configuration: loads
- Discord member → Discord: uses
- Discord → Slash dispatch: dispatches
- Slash dispatch → Study commands: dispatches
- Command registry → Discord: registers commands
- Study commands → Planning command: routes
- Study commands → Homework commands: routes
- Study commands → Add homework: routes
- Planning command → StudySuite client: requests events
- Homework commands → StudySuite client: requests assignments
- Add homework → StudySuite client: creates assignment
- StudySuite client → StudySuite API: calls API
- Planning command → Planning and homework formatting: formats schedule
- Study commands → Discord: replies
- Discord → Event registry: dispatches events
- Event registry → Discord: registers listeners
- Discord → Audit listeners: provides audit events
- Discord → Message listeners: provides message events
- Discord → Honeypot listener: provides messages
- Channel lock command → Channel lock service: changes lock
- Channel lock service → Discord: updates permissions
- Message cache service → Message repository: loads and writes
- Message repository → SQLite database: queries
