Why three platform layers
Lingchu Bot organizes platform support around three layers: platform, protocol, and implementation. This separation keeps each layer’s behavior, capabilities, and configuration concerns isolated instead of mixing them into a single page.
Layer model
Section titled “Layer model”| Layer | Purpose | Examples |
|---|---|---|
| Platform | The chat network the bot connects to | |
| Protocol | The wire/API standard the adapter implements | OneBot V11 |
| Implementation | A concrete server that speaks the protocol | NapCat, default |
A platform profile (in platforms/registry.py) declares the known protocols and their priority. Each protocol maps to a NoneBot adapter package. Within a protocol, one or more implementations may extend the default handler set with implementation-specific APIs.
Why three layers
Section titled “Why three layers”Collapsing platform, protocol, and implementation into one concept loses information that matters at runtime. The same QQ platform can be reached through the OneBot V11 protocol, but the implementation running that protocol determines which APIs are available — NapCat exposes _send_group_notice for group announcements, while a generic OneBot V11 server does not. The three-layer model lets the menu filter commands by the exact implementation detected, rather than advertising commands that would fail.
Available platforms
Section titled “Available platforms”| Platform | Protocols | Status |
|---|---|---|
| OneBot V11 | Implemented | |
| Telegram | Telegram Bot API | Implemented |
For protocol-side runtime setup, see the connection guides under How-to → Connect.
How commands are scoped
Section titled “How commands are scoped”Command handlers live under handle/<platform>/adapters/<protocol>/<implementation>/. The menu system filters visible commands by the active platform, protocol, and implementation at runtime, so implementation-specific extension APIs (for example, group announcements on NapCat) are hidden unless the current runtime is known to support them.
See the QQ platform reference for protocol- and implementation-specific command references.