# carlgroth/carl-bot architecture

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

- Interactive diagram: https://gitdiagram.com/carlgroth/carl-bot
- Repository: https://github.com/carlgroth/carl-bot

## Overview

This is an outdated Discord bot offering server administration, moderation, community commands, game integrations, and activity tracking. The main user workflow is a Discord member sending a command or message, which the bot processes and answers; the README also describes a web dashboard for configuration. The excerpts show several command handlers and message listeners, but not cog loading or the dashboard implementation, so those connections are not inferred. Groups and capabilities reflect the README and source index; some cogs are represented by path only.

Main entry points: [`bot.py`](https://github.com/carlgroth/carl-bot/blob/master/bot.py) (Command runtime), [`cogs/twitch.py`](https://github.com/carlgroth/carl-bot/blob/master/cogs/twitch.py) (Twitch announcements), [`cogs/mod.py`](https://github.com/carlgroth/carl-bot/blob/master/cogs/mod.py) (Command moderation), [`cogs/roles.py`](https://github.com/carlgroth/carl-bot/blob/master/cogs/roles.py) (Role management)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_bot["Command runtime<br/>[bot.py]"]
end

subgraph group_moderation["Server management"]
  node_mod["Command moderation<br/>[mod.py]"]
  node_automod["Automated moderation<br/>[automod.py]"]
  node_roles["Role management<br/>[roles.py]"]
end

subgraph group_community["Community commands"]
  node_tags["Custom tags<br/>[tags.py]"]
  node_highlight["Keyword highlights<br/>[highlight.py]"]
  node_poll["Poll commands<br/>[poll.py]"]
  node_ping["Ping commands<br/>[ping.py]"]
  node_meta["Bot utilities<br/>[meta.py]"]
  node_ckc["Community utilities<br/>[ckc.py]"]
end

subgraph group_integrations["External integrations"]
  node_blizzard["Blizzard game info<br/>[blizzard.py]"]
  node_twitch["Twitch announcements<br/>[twitch.py]"]
end

subgraph group_engagement["Activity features"]
  node_stats["Activity reports<br/>[stats.py]"]
  node_stattrak["Message tracking<br/>[stattrak.py]"]
end

node_discord_member(("Discord member"))
node_dashboard["Configuration dashboard"]
node_twitch_api["Twitch API"]
node_blizzard_api["Blizzard API"]
node_sqlite[("SQLite database")]

node_discord_member -->|"sends messages"| node_bot
node_bot -->|"processes commands"| node_discord_member
node_dashboard -.->|"configures"| node_bot
node_blizzard -->|"fetches character data"| node_blizzard_api
node_twitch -->|"queries streams"| node_twitch_api
node_ckc -->|"reads and writes"| node_sqlite
node_mod -->|"reads and writes"| node_sqlite
node_roles -->|"reads and writes"| node_sqlite
node_tags -->|"reads and writes"| node_sqlite
node_highlight -->|"reads and writes"| node_sqlite
node_twitch -->|"reads and writes"| node_sqlite
node_stattrak -->|"stores messages"| node_sqlite
node_stats -->|"queries activity"| node_sqlite

click node_bot "https://github.com/carlgroth/carl-bot/blob/master/bot.py"
click node_mod "https://github.com/carlgroth/carl-bot/blob/master/cogs/mod.py"
click node_automod "https://github.com/carlgroth/carl-bot/blob/master/cogs/automod.py"
click node_roles "https://github.com/carlgroth/carl-bot/blob/master/cogs/roles.py"
click node_tags "https://github.com/carlgroth/carl-bot/blob/master/cogs/tags.py"
click node_highlight "https://github.com/carlgroth/carl-bot/blob/master/cogs/highlight.py"
click node_poll "https://github.com/carlgroth/carl-bot/blob/master/cogs/poll.py"
click node_ping "https://github.com/carlgroth/carl-bot/blob/master/cogs/ping.py"
click node_meta "https://github.com/carlgroth/carl-bot/blob/master/cogs/meta.py"
click node_ckc "https://github.com/carlgroth/carl-bot/blob/master/cogs/ckc.py"
click node_blizzard "https://github.com/carlgroth/carl-bot/blob/master/cogs/blizzard.py"
click node_twitch "https://github.com/carlgroth/carl-bot/blob/master/cogs/twitch.py"
click node_stats "https://github.com/carlgroth/carl-bot/blob/master/cogs/stats.py"
click node_stattrak "https://github.com/carlgroth/carl-bot/blob/master/cogs/stattrak.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_bot toneBlue
class node_mod,node_automod,node_roles,node_sqlite toneAmber
class node_tags,node_highlight,node_poll,node_ping,node_meta,node_ckc,node_twitch_api,node_blizzard_api toneMint
class node_blizzard,node_twitch toneRose
class node_stats,node_stattrak,node_discord_member,node_dashboard toneIndigo
```

## Components

### Bot runtime

- [Command runtime](https://github.com/carlgroth/carl-bot/blob/master/bot.py): `bot.py`

### Server management

- [Command moderation](https://github.com/carlgroth/carl-bot/blob/master/cogs/mod.py): `cogs/mod.py`
- [Automated moderation](https://github.com/carlgroth/carl-bot/blob/master/cogs/automod.py): `cogs/automod.py`
- [Role management](https://github.com/carlgroth/carl-bot/blob/master/cogs/roles.py): `cogs/roles.py`

### Community commands

- [Custom tags](https://github.com/carlgroth/carl-bot/blob/master/cogs/tags.py): `cogs/tags.py`
- [Keyword highlights](https://github.com/carlgroth/carl-bot/blob/master/cogs/highlight.py): `cogs/highlight.py`
- [Poll commands](https://github.com/carlgroth/carl-bot/blob/master/cogs/poll.py): `cogs/poll.py`
- [Ping commands](https://github.com/carlgroth/carl-bot/blob/master/cogs/ping.py): `cogs/ping.py`
- [Bot utilities](https://github.com/carlgroth/carl-bot/blob/master/cogs/meta.py): `cogs/meta.py`
- [Community utilities](https://github.com/carlgroth/carl-bot/blob/master/cogs/ckc.py): `cogs/ckc.py`

### External integrations

- [Blizzard game info](https://github.com/carlgroth/carl-bot/blob/master/cogs/blizzard.py): `cogs/blizzard.py`
- [Twitch announcements](https://github.com/carlgroth/carl-bot/blob/master/cogs/twitch.py): `cogs/twitch.py`

### Activity features

- [Activity reports](https://github.com/carlgroth/carl-bot/blob/master/cogs/stats.py): `cogs/stats.py`
- [Message tracking](https://github.com/carlgroth/carl-bot/blob/master/cogs/stattrak.py): `cogs/stattrak.py`

### Other components

- **Discord member**
- **Configuration dashboard**
- **Twitch API**
- **Blizzard API**
- **SQLite database**

## Connections

- Discord member → Command runtime: sends messages (evidence: `bot.py`)
- Command runtime → Discord member: processes commands (evidence: `bot.py`)
- Configuration dashboard → Command runtime: configures (evidence: `readme.md`)
- Blizzard game info → Blizzard API: fetches character data (evidence: `cogs/blizzard.py`)
- Twitch announcements → Twitch API: queries streams (evidence: `cogs/twitch.py`)
- Community utilities → SQLite database: reads and writes (evidence: `cogs/ckc.py`)
- Command moderation → SQLite database: reads and writes (evidence: `cogs/mod.py`)
- Role management → SQLite database: reads and writes (evidence: `cogs/roles.py`)
- Custom tags → SQLite database: reads and writes (evidence: `cogs/tags.py`)
- Keyword highlights → SQLite database: reads and writes (evidence: `cogs/highlight.py`)
- Twitch announcements → SQLite database: reads and writes (evidence: `cogs/twitch.py`)
- Message tracking → SQLite database: stores messages (evidence: `cogs/stattrak.py`)
- Activity reports → SQLite database: queries activity (evidence: `cogs/stats.py`)
