# the-programmers-hangout/swiftspiracy-bot architecture

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

- Interactive diagram: https://gitdiagram.com/the-programmers-hangout/swiftspiracy-bot
- Repository: https://github.com/the-programmers-hangout/swiftspiracy-bot

## Overview

swiftspiracy is a Discord bot that loads configured message content, schedules praise posts with occasional conspiracy posts, and deletes conspiracy messages after a delay. Its main runtime also registers a build-info interaction and handles graceful shutdown. The implementation is concentrated in one Go file; the JSON files are embedded inputs, not separate runtime modules. Edges reflect calls shown in that file or capabilities documented in the README.

Main entry points: [`cmd/bot/main.go`](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go) (Bot startup), [`cmd/bot/praises.json`](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/praises.json) (Praise data), [`cmd/bot/conspiracies.json`](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/conspiracies.json) (Conspiracy data)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_main["Bot startup<br/>[main.go]"]
  node_config["Environment config<br/>[main.go]"]
  node_commands["Interaction commands<br/>[main.go]"]
  node_scheduler["Message scheduler<br/>[main.go]"]
  node_sender["Message sender<br/>[main.go]"]
  node_deleter["Delayed deletion<br/>[main.go]"]
end

subgraph group_content["Message content"]
  node_praises["Praise data<br/>[praises.json]"]
  node_conspiracies["Conspiracy data<br/>[conspiracies.json]"]
end

subgraph group_discord["Discord services"]
  node_discord["Discord platform"]
end

node_operator(("Operator"))

node_operator -->|"starts bot"| node_main
node_main -->|"loads settings"| node_config
node_main -->|"registers handlers"| node_commands
node_main -->|"starts scheduler"| node_scheduler
node_main -->|"opens session"| node_discord
node_main -->|"loads embedded"| node_praises
node_main -->|"loads embedded"| node_conspiracies
node_scheduler -->|"sends messages"| node_sender
node_scheduler -->|"schedules deletion"| node_deleter
node_sender -->|"posts message"| node_discord
node_deleter -->|"deletes message"| node_discord
node_commands -->|"responds to command"| node_discord

click node_main "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go"
click node_config "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go"
click node_commands "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go"
click node_scheduler "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go"
click node_sender "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go"
click node_deleter "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go"
click node_praises "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/praises.json"
click node_conspiracies "https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/conspiracies.json"

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_config,node_commands,node_scheduler,node_sender,node_deleter toneBlue
class node_praises,node_conspiracies toneAmber
class node_discord toneMint
class node_operator toneIndigo
```

## Components

### Bot runtime

- [Bot startup](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go): `cmd/bot/main.go`
- [Environment config](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go): `cmd/bot/main.go`
- [Interaction commands](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go): `cmd/bot/main.go`
- [Message scheduler](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go): `cmd/bot/main.go`
- [Message sender](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go): `cmd/bot/main.go`
- [Delayed deletion](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/main.go): `cmd/bot/main.go`

### Message content

- [Praise data](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/praises.json): `cmd/bot/praises.json`
- [Conspiracy data](https://github.com/the-programmers-hangout/swiftspiracy-bot/blob/main/cmd/bot/conspiracies.json): `cmd/bot/conspiracies.json`

### Discord services

- **Discord platform**

### Other components

- **Operator**

## Connections

- Operator → Bot startup: starts bot (evidence: `README.md`)
- Bot startup → Environment config: loads settings (evidence: `cmd/bot/main.go`)
- Bot startup → Interaction commands: registers handlers (evidence: `cmd/bot/main.go`)
- Bot startup → Message scheduler: starts scheduler (evidence: `cmd/bot/main.go`)
- Bot startup → Discord platform: opens session (evidence: `cmd/bot/main.go`)
- Bot startup → Praise data: loads embedded (evidence: `cmd/bot/main.go`)
- Bot startup → Conspiracy data: loads embedded (evidence: `cmd/bot/main.go`)
- Message scheduler → Message sender: sends messages (evidence: `cmd/bot/main.go`)
- Message scheduler → Delayed deletion: schedules deletion (evidence: `cmd/bot/main.go`)
- Message sender → Discord platform: posts message (evidence: `cmd/bot/main.go`)
- Delayed deletion → Discord platform: deletes message (evidence: `cmd/bot/main.go`)
- Interaction commands → Discord platform: responds to command (evidence: `cmd/bot/main.go`)
