# 510208/cfbot architecture

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

- Interactive diagram: https://gitdiagram.com/510208/cfbot
- Repository: https://github.com/510208/cfbot

## Overview

CfBot is a Discord bot for Minecraft-community server administration and member services. A user or administrator interacts through Discord commands, messages, reactions, and ticket controls; the bot dispatches these through its loaded cogs, which perform community workflows and return Discord responses or update server state. A key domain workflow is linking Discord identities to Minecraft players, looking up player data, then presenting results. The tree and README identify additional cogs, but their implementations were not sampled, so their detailed wiring is not asserted.

Main entry points: [`main.py`](https://github.com/510208/cfbot/blob/main/main.py) (Bot entry and dispatch), [`Cogs/ptersearch.py`](https://github.com/510208/cfbot/blob/main/Cogs/ptersearch.py) (Player search), [`plugins/mcsm_client.py`](https://github.com/510208/cfbot/blob/main/plugins/mcsm_client.py) (Identity and player client), [`plugins/discordcore.py`](https://github.com/510208/cfbot/blob/main/plugins/discordcore.py) (Pterodactyl lookup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Bot runtime"]
  node_main["Bot entry and dispatch<br/>[main.py]"]
  node_config["Bot configuration<br/>[cfg.yml]"]
end

subgraph group_community["Community features"]
  node_announcements["Announcements<br/>[annou.py]"]
  node_announcement_status["Maintenance status<br/>[annou_stat.py]"]
  node_tickets["Support tickets<br/>[ticket.py]"]
  node_roles["Reaction roles<br/>[reaction_roles.py]"]
  node_welcome["Welcome messages<br/>[welcome.py]"]
  node_auto_reply["Automatic replies<br/>[auto_reply.py]"]
  node_about["About command<br/>[about.py]"]
end

subgraph group_operations["Server operations"]
  node_auto_delete["Automatic deletion<br/>[auto_delete.py]"]
  node_logging["Discord logging<br/>[dclogging.py]"]
  node_server_stats["Server statistics<br/>[serverstats.py]"]
  node_pterodactyl["Pterodactyl integration<br/>[pterodactyl.py]"]
end

subgraph group_players["Minecraft identity"]
  node_player_search["Player search<br/>[ptersearch.py]"]
  node_identity_client["Identity and player client<br/>[mcsm_client.py]"]
  node_discord_core["Pterodactyl lookup<br/>[discordcore.py]"]
  node_mapping_db[("Player mappings<br/>[playermapping.db]")]
end

node_members(("Discord members"))
node_admins(("Bot administrators"))
node_discord(("Discord platform"))
node_minecraft_services(("Minecraft and MCSM services"))

node_admins -->|"admin commands"| node_main
node_members -->|"bot interactions"| node_main
node_main -->|"connects to"| node_discord
node_main -->|"reads settings"| node_config
node_main -->|"loads cog"| node_announcements
node_main -->|"loads cog"| node_announcement_status
node_main -->|"loads cog"| node_tickets
node_main -->|"loads cog"| node_roles
node_main -->|"loads cog"| node_welcome
node_main -->|"loads cog"| node_auto_reply
node_main -->|"loads cog"| node_about
node_main -->|"loads cog"| node_auto_delete
node_main -->|"loads cog"| node_logging
node_main -->|"loads cog"| node_server_stats
node_main -->|"loads cog"| node_pterodactyl
node_main -->|"loads cog"| node_player_search
node_announcements -->|"publishes updates"| node_discord
node_announcement_status -->|"edits status message"| node_discord
node_tickets -->|"creates and closes tickets"| node_discord
node_roles -->|"assigns roles"| node_discord
node_welcome -->|"welcomes members"| node_discord
node_auto_reply -->|"sends replies"| node_discord
node_auto_delete -->|"deletes messages"| node_discord
node_logging -->|"records events"| node_discord
node_server_stats -->|"updates channel names"| node_discord
node_pterodactyl -.->|"manages servers"| node_minecraft_services
node_admins -->|"requests sync"| node_player_search
node_members -->|"requests lookup"| node_player_search
node_player_search -->|"syncs identities"| node_identity_client
node_player_search -->|"looks up mappings"| node_discord_core
node_identity_client -->|"fetches identity data"| node_minecraft_services
node_discord_core -->|"queries panel API"| node_minecraft_services
node_identity_client -->|"reads and writes mappings"| node_mapping_db
node_discord_core -->|"reads and writes mappings"| node_mapping_db
node_player_search -->|"returns player results"| node_discord

click node_main "https://github.com/510208/cfbot/blob/main/main.py"
click node_config "https://github.com/510208/cfbot/blob/main/cfg.yml"
click node_announcements "https://github.com/510208/cfbot/blob/main/Cogs/annou/annou.py"
click node_announcement_status "https://github.com/510208/cfbot/blob/main/Cogs/annou/annou_stat.py"
click node_tickets "https://github.com/510208/cfbot/blob/main/Cogs/tickets/ticket.py"
click node_roles "https://github.com/510208/cfbot/blob/main/Cogs/reaction_roles/reaction_roles.py"
click node_welcome "https://github.com/510208/cfbot/blob/main/Cogs/welcome.py"
click node_auto_reply "https://github.com/510208/cfbot/blob/main/Cogs/auto_reply.py"
click node_about "https://github.com/510208/cfbot/blob/main/Cogs/about/about.py"
click node_auto_delete "https://github.com/510208/cfbot/blob/main/Cogs/auto_delete.py"
click node_logging "https://github.com/510208/cfbot/blob/main/Cogs/dclogging.py"
click node_server_stats "https://github.com/510208/cfbot/blob/main/Cogs/serverstats/serverstats.py"
click node_pterodactyl "https://github.com/510208/cfbot/blob/main/Cogs/pterodactyl.py"
click node_player_search "https://github.com/510208/cfbot/blob/main/Cogs/ptersearch.py"
click node_identity_client "https://github.com/510208/cfbot/blob/main/plugins/mcsm_client.py"
click node_discord_core "https://github.com/510208/cfbot/blob/main/plugins/discordcore.py"
click node_mapping_db "https://github.com/510208/cfbot/blob/main/databases/playermapping.db"

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 toneBlue
class node_announcements,node_announcement_status,node_tickets,node_roles,node_welcome,node_auto_reply,node_about toneAmber
class node_auto_delete,node_logging,node_server_stats,node_pterodactyl toneMint
class node_player_search,node_identity_client,node_discord_core,node_mapping_db toneRose
class node_members,node_admins,node_discord,node_minecraft_services toneIndigo
```

## Components

### Bot runtime

- [Bot entry and dispatch](https://github.com/510208/cfbot/blob/main/main.py): `main.py`
- [Bot configuration](https://github.com/510208/cfbot/blob/main/cfg.yml): `cfg.yml`

### Community features

- [Announcements](https://github.com/510208/cfbot/blob/main/Cogs/annou/annou.py): `Cogs/annou/annou.py`
- [Maintenance status](https://github.com/510208/cfbot/blob/main/Cogs/annou/annou_stat.py): `Cogs/annou/annou_stat.py`
- [Support tickets](https://github.com/510208/cfbot/blob/main/Cogs/tickets/ticket.py): `Cogs/tickets/ticket.py`
- [Reaction roles](https://github.com/510208/cfbot/blob/main/Cogs/reaction_roles/reaction_roles.py): `Cogs/reaction_roles/reaction_roles.py`
- [Welcome messages](https://github.com/510208/cfbot/blob/main/Cogs/welcome.py): `Cogs/welcome.py`
- [Automatic replies](https://github.com/510208/cfbot/blob/main/Cogs/auto_reply.py): `Cogs/auto_reply.py`
- [About command](https://github.com/510208/cfbot/blob/main/Cogs/about/about.py): `Cogs/about/about.py`

### Server operations

- [Automatic deletion](https://github.com/510208/cfbot/blob/main/Cogs/auto_delete.py): `Cogs/auto_delete.py`
- [Discord logging](https://github.com/510208/cfbot/blob/main/Cogs/dclogging.py): `Cogs/dclogging.py`
- [Server statistics](https://github.com/510208/cfbot/blob/main/Cogs/serverstats/serverstats.py): `Cogs/serverstats/serverstats.py`
- [Pterodactyl integration](https://github.com/510208/cfbot/blob/main/Cogs/pterodactyl.py): `Cogs/pterodactyl.py`

### Minecraft identity

- [Player search](https://github.com/510208/cfbot/blob/main/Cogs/ptersearch.py): `Cogs/ptersearch.py`
- [Identity and player client](https://github.com/510208/cfbot/blob/main/plugins/mcsm_client.py): `plugins/mcsm_client.py`
- [Pterodactyl lookup](https://github.com/510208/cfbot/blob/main/plugins/discordcore.py): `plugins/discordcore.py`
- [Player mappings](https://github.com/510208/cfbot/blob/main/databases/playermapping.db): `databases/playermapping.db`

### Other components

- **Discord members**
- **Bot administrators**
- **Discord platform**
- **Minecraft and MCSM services**

## Connections

- Bot administrators → Bot entry and dispatch: admin commands
- Discord members → Bot entry and dispatch: bot interactions
- Bot entry and dispatch → Discord platform: connects to
- Bot entry and dispatch → Bot configuration: reads settings
- Bot entry and dispatch → Announcements: loads cog
- Bot entry and dispatch → Maintenance status: loads cog
- Bot entry and dispatch → Support tickets: loads cog
- Bot entry and dispatch → Reaction roles: loads cog
- Bot entry and dispatch → Welcome messages: loads cog
- Bot entry and dispatch → Automatic replies: loads cog
- Bot entry and dispatch → About command: loads cog
- Bot entry and dispatch → Automatic deletion: loads cog
- Bot entry and dispatch → Discord logging: loads cog
- Bot entry and dispatch → Server statistics: loads cog
- Bot entry and dispatch → Pterodactyl integration: loads cog
- Bot entry and dispatch → Player search: loads cog
- Announcements → Discord platform: publishes updates
- Maintenance status → Discord platform: edits status message
- Support tickets → Discord platform: creates and closes tickets
- Reaction roles → Discord platform: assigns roles
- Welcome messages → Discord platform: welcomes members
- Automatic replies → Discord platform: sends replies
- Automatic deletion → Discord platform: deletes messages
- Discord logging → Discord platform: records events
- Server statistics → Discord platform: updates channel names
- Pterodactyl integration → Minecraft and MCSM services: manages servers
- Bot administrators → Player search: requests sync
- Discord members → Player search: requests lookup
- Player search → Identity and player client: syncs identities
- Player search → Pterodactyl lookup: looks up mappings
- Identity and player client → Minecraft and MCSM services: fetches identity data
- Pterodactyl lookup → Minecraft and MCSM services: queries panel API
- Identity and player client → Player mappings: reads and writes mappings
- Pterodactyl lookup → Player mappings: reads and writes mappings
- Player search → Discord platform: returns player results
