Drivers Overview
A driver is the adapter between NextBridge and a specific chat platform. Each driver handles receiving messages from its platform and sending messages to it.
Supported platforms
| Platform | Driver | Receive | Send | Notes |
|---|---|---|---|---|
| Tencent QQ | NapCat | ✅ | ✅ | Uses the unofficial NapCat WebSocket bridge |
| Discord | Discord | ✅ | ✅ | Receive via bot gateway; send via webhook or bot |
| Telegram | Telegram | ✅ | ✅ | Uses long polling |
| Feishu / Lark | Feishu | ✅ | ✅ | Webhook receive; IM API send |
| DingTalk | DingTalk | ✅ | ✅ | Webhook receive; Robot API send |
How drivers work
Every driver:
- Registers a sender with the bridge on startup so the bridge can call it to deliver messages.
- Listens for incoming messages (WebSocket, long-polling, or HTTP webhook).
- Normalizes each incoming message into a
NormalizedMessageand passes it to the bridge. - Sends formatted text and attachments when the bridge calls its sender.
Media handling
All drivers share a common media-download utility. When a message with attachments arrives, the bridge passes the attachment list to the target driver's send() method. Each driver downloads the file (up to max_file_size bytes) and re-uploads it using the target platform's native API.
If a file exceeds the size limit or the download fails, a text fallback is appended to the message:
[Image: photo.jpg](https://example.com/photo.jpg)