Skip to content

refactor: split mcbot.py into focused modules - #34

Merged
sg merged 1 commit into
mainfrom
refactor/split-mcbot
Jul 5, 2026
Merged

refactor: split mcbot.py into focused modules#34
sg merged 1 commit into
mainfrom
refactor/split-mcbot

Conversation

@sg

@sg sg commented Jul 5, 2026

Copy link
Copy Markdown
Owner

What changed

  • Split the 4,335-line mcbot.py into seven modules, all code moved verbatim: protocol.py (packet constants/envelope parsing), crypto.py (key derivation, DM/channel decryption), config.py (Config, conf loading, logging setup), db.py (schema + DB wrapper), plugins.py (command loader/context), eviction.py (contact-table eviction), bot.py (MCBot).
  • mcbot.py keeps the CLI entry point and re-exports all public names, so import mcbot, tests, and systemd invocation are unchanged.
  • webapi/decode.py now imports protocol/crypto directly; management.py drops its cycle-avoiding local import mcbot.

Why

Separates pure protocol/crypto/config code from the bot runtime; smaller reviewable files.

Breaking changes

None. All 12 tests pass; --help and webapi imports verified.

🤖 Generated with Claude Code

@sg
sg merged commit 99fed68 into main Jul 5, 2026
1 check passed
@sg
sg deleted the refactor/split-mcbot branch July 5, 2026 18:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant