# kamcdev/jsoft_markbot_mjbcore architecture

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

- Interactive diagram: https://gitdiagram.com/kamcdev/jsoft_markbot_mjbcore
- Repository: https://github.com/kamcdev/jsoft_markbot_mjbcore

## Overview

Jsoft_markbot_mjbcore is a Python QQ bot framework using a OneBot 11 client, with dynamically loaded command plugins and a browser-based status panel. Its main workflow is: OneBot events arrive through the webhook service, message handling routes them to commands or registered interceptors, and handlers use the OneBot API wrapper to act in QQ. Configuration, account routing, logging, and background workers support that flow. The README documents plugin extensibility and the WebUI; unsampled subsystems are represented only where documented or referenced in the supplied source index.

Main entry points: [`bin/message.py`](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/message.py) (Event handling), [`bin/mjbconfig.py`](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbconfig.py) (Account configuration), [`bin/mjbc.py`](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbc.py) (Command dispatch), [`bot_v1_1.0.3.py`](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bot_v1_1.0.3.py) (Bot startup)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Runtime and events"]
  node_launcher["Bot startup<br/>[bot_v1_1.0.3.py]"]
  node_webhook["Webhook server<br/>[socket.py]"]
  node_events["Event handling<br/>[message.py]"]
  node_parser["OneBot parser<br/>[onebot_parse.py]"]
end

subgraph group_features["Commands and plugins"]
  node_commands["Command dispatch<br/>[mjbc.py]"]
  node_welcome["Group welcome<br/>[groupwelcome.py]"]
  node_filter["Word filter<br/>[filter.py]"]
  node_menu["Command menus<br/>[mjbmenu.py]"]
end

subgraph group_services["Shared services"]
  node_config["Account configuration<br/>[mjbconfig.py]"]
  node_account_data["Bot configuration files"]
  node_core_settings["Core settings<br/>[coreset.json]"]
  node_api["OneBot API wrapper<br/>[send.py]"]
  node_workers["Background workers<br/>[worker.py]"]
  node_logger["Logging<br/>[logger.py]"]
  node_utils["Bot utilities<br/>[mjbutils.py]"]
end

subgraph group_web["Web operations"]
  node_status["System status<br/>[mjbstatus.py]"]
  node_webserver["WebUI server<br/>[webmain.py]"]
  node_webui["Web dashboard<br/>[index.html]"]
end

node_operator(("Bot operator"))
node_onebot{{"OneBot client"}}

node_operator -->|"starts bot"| node_launcher
node_launcher -->|"starts service"| node_webhook
node_launcher -->|"starts dashboard"| node_webserver
node_onebot -.->|"posts events"| node_webhook
node_webhook -->|"dispatches events"| node_events
node_events -->|"parses segments"| node_parser
node_events -->|"dispatches commands"| node_commands
node_launcher -->|"loads plugins"| node_commands
node_launcher -->|"loads settings"| node_config
node_launcher -->|"manages workers"| node_workers
node_events -->|"reads settings"| node_config
node_events -->|"starts polling"| node_workers
node_events -->|"logs events"| node_logger
node_commands -->|"sends actions"| node_api
node_commands -->|"reads settings"| node_config
node_commands -->|"uses menus"| node_menu
node_commands -->|"uses status"| node_status
node_commands -->|"uses utilities"| node_utils
node_welcome -->|"sends messages"| node_api
node_welcome -->|"reads settings"| node_config
node_welcome -->|"starts checks"| node_workers
node_welcome -->|"uses message hooks"| node_events
node_filter -->|"registers interceptor"| node_events
node_filter -->|"deletes messages"| node_api
node_filter -->|"reads settings"| node_config
node_filter -->|"checks admins"| node_utils
node_config -.->|"loads account data"| node_account_data
node_config -.->|"loads core settings"| node_core_settings
node_api -->|"calls HTTP API"| node_onebot
node_api -->|"resolves account"| node_config
node_webserver -->|"reports status"| node_status
node_webserver -->|"reads heartbeat"| node_events
node_webserver -->|"reads settings"| node_config
node_webserver -->|"reads threads"| node_workers
node_operator -->|"opens dashboard"| node_webui

click node_launcher "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bot_v1_1.0.3.py"
click node_webhook "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/socket.py"
click node_events "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/message.py"
click node_parser "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/onebot_parse.py"
click node_commands "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbc.py"
click node_welcome "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/modules/groupwelcome.py"
click node_filter "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/modules/filter.py"
click node_config "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbconfig.py"
click node_account_data "https://github.com/kamcdev/jsoft_markbot_mjbcore/tree/main/config"
click node_core_settings "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/coreset.json"
click node_api "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/send.py"
click node_workers "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/worker.py"
click node_logger "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/logger.py"
click node_utils "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbutils.py"
click node_menu "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbmenu.py"
click node_status "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbstatus.py"
click node_webserver "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/webmain.py"
click node_webui "https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/webui/index.html"

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_launcher,node_webhook,node_events,node_parser,node_onebot toneBlue
class node_commands,node_welcome,node_filter,node_menu toneAmber
class node_config,node_account_data,node_core_settings,node_api,node_workers,node_logger,node_utils toneMint
class node_status,node_webserver,node_webui toneRose
class node_operator toneIndigo
```

## Components

### Runtime and events

- [Bot startup](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bot_v1_1.0.3.py): `bot_v1_1.0.3.py`
- [Webhook server](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/socket.py): `bin/socket.py`
- [Event handling](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/message.py): `bin/message.py`
- [OneBot parser](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/onebot_parse.py): `bin/onebot_parse.py`

### Commands and plugins

- [Command dispatch](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbc.py): `bin/mjbc.py`
- [Group welcome](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/modules/groupwelcome.py): `modules/groupwelcome.py`
- [Word filter](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/modules/filter.py): `modules/filter.py`
- [Command menus](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbmenu.py): `bin/mjbmenu.py`

### Shared services

- [Account configuration](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbconfig.py): `bin/mjbconfig.py`
- [Bot configuration files](https://github.com/kamcdev/jsoft_markbot_mjbcore/tree/main/config): `config`
- [Core settings](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/coreset.json): `coreset.json`
- [OneBot API wrapper](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/send.py): `bin/send.py`
- [Background workers](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/worker.py): `bin/worker.py`
- [Logging](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/logger.py): `bin/logger.py`
- [Bot utilities](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbutils.py): `bin/mjbutils.py`

### Web operations

- [System status](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/mjbstatus.py): `bin/mjbstatus.py`
- [WebUI server](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/bin/webmain.py): `bin/webmain.py`
- [Web dashboard](https://github.com/kamcdev/jsoft_markbot_mjbcore/blob/main/webui/index.html): `webui/index.html`

### Other components

- **Bot operator**
- **OneBot client**

## Connections

- Bot operator → Bot startup: starts bot (evidence: `README.md`)
- Bot startup → Webhook server: starts service (evidence: `bot_v1_1.0.3.py`)
- Bot startup → WebUI server: starts dashboard (evidence: `bot_v1_1.0.3.py`)
- OneBot client → Webhook server: posts events (evidence: `README.md`)
- Webhook server → Event handling: dispatches events (evidence: `bin/socket.py`)
- Event handling → OneBot parser: parses segments (evidence: `bin/message.py`)
- Event handling → Command dispatch: dispatches commands (evidence: `bin/message.py`)
- Bot startup → Command dispatch: loads plugins (evidence: `bot_v1_1.0.3.py`)
- Bot startup → Account configuration: loads settings (evidence: `bot_v1_1.0.3.py`)
- Bot startup → Background workers: manages workers (evidence: `bot_v1_1.0.3.py`)
- Event handling → Account configuration: reads settings (evidence: `bin/message.py`)
- Event handling → Background workers: starts polling (evidence: `bin/message.py`)
- Event handling → Logging: logs events (evidence: `bin/message.py`)
- Command dispatch → OneBot API wrapper: sends actions (evidence: `bin/mjbc.py`)
- Command dispatch → Account configuration: reads settings (evidence: `bin/mjbc.py`)
- Command dispatch → Command menus: uses menus (evidence: `bin/mjbc.py`)
- Command dispatch → System status: uses status (evidence: `bin/mjbc.py`)
- Command dispatch → Bot utilities: uses utilities (evidence: `bin/mjbc.py`)
- Group welcome → OneBot API wrapper: sends messages (evidence: `modules/groupwelcome.py`)
- Group welcome → Account configuration: reads settings (evidence: `modules/groupwelcome.py`)
- Group welcome → Background workers: starts checks (evidence: `modules/groupwelcome.py`)
- Group welcome → Event handling: uses message hooks (evidence: `modules/groupwelcome.py`)
- Word filter → Event handling: registers interceptor (evidence: `modules/filter.py`)
- Word filter → OneBot API wrapper: deletes messages (evidence: `modules/filter.py`)
- Word filter → Account configuration: reads settings (evidence: `modules/filter.py`)
- Word filter → Bot utilities: checks admins (evidence: `modules/filter.py`)
- Account configuration → Bot configuration files: loads account data
- Account configuration → Core settings: loads core settings
- OneBot API wrapper → OneBot client: calls HTTP API (evidence: `bin/send.py`)
- OneBot API wrapper → Account configuration: resolves account (evidence: `bin/send.py`)
- WebUI server → System status: reports status (evidence: `bin/webmain.py`)
- WebUI server → Event handling: reads heartbeat (evidence: `bin/webmain.py`)
- WebUI server → Account configuration: reads settings (evidence: `bin/webmain.py`)
- WebUI server → Background workers: reads threads (evidence: `bin/webmain.py`)
- Bot operator → Web dashboard: opens dashboard (evidence: `README.md`)
