Skip to main content
xbot
Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Toggle Dark/Light/Auto mode Back to homepage

NapCat Channel

Connect xbot via NapCat, implementing the OneBot 11 protocol. Compatible with any OneBot 11 implementation.

Requires Server mode.

QQ channel vs. NapCat

QQ ChannelNapCat Channel
ProtocolQQ Official Bot APIOneBot 11
RequiresQQ Open Platform registrationRunning NapCat instance
AccountBot applicationPersonal QQ account
StabilityOfficial supportDepends on NapCat

Prerequisites

  1. xbot installed and running in Server mode
  2. A running NapCat instance (via QQNT + NapCat plugin)
  3. WebSocket server mode enabled in NapCat configuration

Configuration

{
  "napcat": {
    "enabled": true,
    "ws_url": "ws://127.0.0.1:3001",
    "token": "",
    "allow_from": []
  }
}
FieldRequiredDefaultDescription
enabledfalseEnable the NapCat channel
ws_url"ws://localhost:3001"NapCat WebSocket URL
token""Authentication token (if NapCat is configured with one)
allow_from[]Whitelist of QQ numbers; empty = allow all

Usage

  • Private chat: send a message to the bot’s QQ number directly
  • Group chat: @mention the bot’s QQ number + your question

Notes

  • NapCat does not support message updates, so streaming rendering is not visible
  • Supports sending images and files
  • Supports automatic reconnection with exponential backoff (max 5 minutes)

Troubleshooting

IssueSolution
WebSocket connection failsVerify NapCat is running and the WS URL is correct
Messages not receivedCheck that the allow-list includes the sender’s QQ number
Reconnection loopsCheck network stability; NapCat has exponential backoff

See also