# tristanofjugdral/mc2jtd architecture

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

- Interactive diagram: https://gitdiagram.com/tristanofjugdral/mc2jtd
- Repository: https://github.com/tristanofjugdral/mc2jtd

## Overview

MC2JTD is a Discord bot that relays Cobbleverse Minecraft chat-log events into a configured Discord channel. Administrators use prefixed commands to select a local log or configure SFTP, set the destination and adjust message, notification and role settings; a background reader tails the selected source, filters and formats relevant lines, then posts them to Discord. The sampled code shows separate local and remote readers, shared settings persistence, and command-driven reader restarts. The imported censor helper is absent from the supplied tree, so it is not represented separately.

Main entry points: [`cogs/basic_commands.py`](https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/basic_commands.py) (Admin commands), [`data/settings.py`](https://github.com/tristanofjugdral/mc2jtd/blob/main/data/settings.py) (Settings and persistence), [`cogs/msg_receive.py`](https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/msg_receive.py) (Local log reader), [`cogs/sftp_reader.py`](https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/sftp_reader.py) (SFTP log reader)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_main["Bot startup<br/>[main.py]"]
end

subgraph group_admin["Administration"]
  node_commands["Admin commands<br/>[basic_commands.py]"]
end

subgraph group_ingest["Log ingestion"]
  node_local["Local log reader<br/>[msg_receive.py]"]
  node_sftp["SFTP log reader<br/>[sftp_reader.py]"]
end

subgraph group_state["Configuration"]
  node_settings[("Settings and persistence<br/>[settings.py]")]
end

node_owner(("Bot operator"))
node_discord{{"Discord"}}
node_minecraft["Minecraft logs"]

node_main -->|"loads cog"| node_local
node_main -->|"loads cog"| node_commands
node_main -->|"loads cog"| node_sftp
node_owner -->|"issues commands"| node_commands
node_commands -->|"updates settings"| node_settings
node_commands -->|"restarts reader"| node_local
node_commands -->|"configures and restarts"| node_sftp
node_settings -->|"provides configuration"| node_local
node_settings -->|"provides configuration"| node_sftp
node_settings -->|"reads and writes config"| node_settings
node_minecraft -->|"provides local log"| node_local
node_minecraft -->|"provides remote log"| node_sftp
node_local -->|"posts filtered messages"| node_discord
node_sftp -->|"posts filtered messages"| node_discord
node_commands -->|"replies to commands"| node_discord

click node_main "https://github.com/tristanofjugdral/mc2jtd/blob/main/main.py"
click node_commands "https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/basic_commands.py"
click node_local "https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/msg_receive.py"
click node_sftp "https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/sftp_reader.py"
click node_settings "https://github.com/tristanofjugdral/mc2jtd/blob/main/data/settings.py"

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 toneBlue
class node_commands toneAmber
class node_local,node_sftp toneMint
class node_settings toneRose
class node_owner,node_discord,node_minecraft toneIndigo
```

## Components

### Bot runtime

- [Bot startup](https://github.com/tristanofjugdral/mc2jtd/blob/main/main.py): `main.py`

### Administration

- [Admin commands](https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/basic_commands.py): `cogs/basic_commands.py`

### Log ingestion

- [Local log reader](https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/msg_receive.py): `cogs/msg_receive.py`
- [SFTP log reader](https://github.com/tristanofjugdral/mc2jtd/blob/main/cogs/sftp_reader.py): `cogs/sftp_reader.py`

### Configuration

- [Settings and persistence](https://github.com/tristanofjugdral/mc2jtd/blob/main/data/settings.py): `data/settings.py`

### Other components

- **Bot operator**
- **Discord**
- **Minecraft logs**

## Connections

- Bot startup → Local log reader: loads cog (evidence: `main.py`)
- Bot startup → Admin commands: loads cog (evidence: `main.py`)
- Bot startup → SFTP log reader: loads cog (evidence: `main.py`)
- Bot operator → Admin commands: issues commands (evidence: `cogs/basic_commands.py`)
- Admin commands → Settings and persistence: updates settings (evidence: `cogs/basic_commands.py`)
- Admin commands → Local log reader: restarts reader (evidence: `cogs/basic_commands.py`)
- Admin commands → SFTP log reader: configures and restarts (evidence: `cogs/basic_commands.py`)
- Settings and persistence → Local log reader: provides configuration (evidence: `cogs/msg_receive.py`)
- Settings and persistence → SFTP log reader: provides configuration (evidence: `cogs/sftp_reader.py`)
- Settings and persistence → Settings and persistence: reads and writes config (evidence: `data/settings.py`)
- Minecraft logs → Local log reader: provides local log (evidence: `cogs/msg_receive.py`)
- Minecraft logs → SFTP log reader: provides remote log (evidence: `cogs/sftp_reader.py`)
- Local log reader → Discord: posts filtered messages (evidence: `cogs/msg_receive.py`)
- SFTP log reader → Discord: posts filtered messages (evidence: `cogs/sftp_reader.py`)
- Admin commands → Discord: replies to commands (evidence: `cogs/basic_commands.py`)
