For AI agents: the complete documentation index is available at /en/llms.txt, the full documentation bundle is available at /en/llms-full.txt, and this page is available as Markdown at /en/guide/qq-bridge.md.
  • English
  • QQ bridge

    Two backends (qq_config.json → qq_backend):

    BackendNotes
    official (default)QQ Open Platform official bot (Access Token + Gateway)
    llbotLLBot (OneBot 11)

    SFMC only bridges messages; the MC envelope remains /api/sfmc/messages.

    Message path

    Official (qq_backend: "official")

    QQ → MC:  Official Gateway ─WS→ qq-bridge ─POST→ db-server
    MC → QQ:  db-server ─HTTPS→ OpenAPI /v2/groups/{group_openid}/messages
    • QQ→MC: only @bot group messages (GROUP_AT_MESSAGE_CREATE)
    • MC→QQ: active group push (group owner must allow the bot to speak proactively; rate limits apply)

    LLBot (qq_backend: "llbot")

    QQ → MC:  LLBot ─WS:3002→ qq-bridge ─POST→ db-server
    MC → QQ:  db-server ─HTTP:3004→ LLBot

    Configuration

    Edit configs/qq_config.json (defaults are created on first start):

    KeyDescription
    qq_backendofficial | llbot; default official
    official.transportwebsocket or webhook; Webhook enables cloud configuration sync
    official.app_id / official.app_secretOfficial bot credentials (do not commit secrets)
    official.sandboxOfficial sandbox; default false
    official.group_openidOfficial group openid (not the numeric group id)
    official.group_panel_idOfficial group command-panel id (written back after sync)
    official.sync_menu_panelSync C2C menu + group panel on official startup; default true
    llbot.ws_portllbot: qq-bridge listen port; default 3002
    llbot.group_idllbot: primary group id; 0 disables
    llbot.enabledWhether sfmc starts LLBot (only when qq_backend=llbot)
    llbot.path / llbot.cwdLLBot executable / working directory
    llbot.host / llbot.port / llbot.tokendb-server MC→QQ (llbot)
    official.admin_openidsQQ admin openids (join approval / join settings); empty = cannot approve
    qq_eventsEvent-to-group switches (see below); default all on, 60s window

    Obtaining official.group_openid

    1. Configure AppID/Secret, add the bot to the group, subscribe to group @ events
    2. Start the qq service and @ the bot in the group
    3. If openid is unset, qq-bridge logs the received group_openid
    4. Copy it into official.group_openid, then restart db-server and qq-bridge

    Official checklist

    1. Subscribe to GROUP_AT_MESSAGE_CREATE in the console
    2. Bot is in the target group
    3. Group owner enables proactive bot messages
    4. Sandbox: configure a sandbox group and set official.sandbox: true
    5. If IP allowlist is on, add the server public IP (production only)

    LLBot setup

    When qq_backend: "llbot", configure reverse WebSocket:

    ws://127.0.0.1:3002

    Upgrading from older installs: set "qq_backend": "llbot" explicitly; otherwise the default is official.

    QQ-side commands (no MC required)

    qq-bridge intercepts commands before forwarding to MC. Same command registry; presentation differs by backend:

    TriggerBehavior
    菜单 / help / /helpCommon commands; official Markdown + keyboard, llbot numbered menu
    ping / /pingLiveness probe
    whoami / 我的绑定QQ id; shows MC name if bound
    status / 状态Server summary: online, world, host uptime, BDS/db uptime, memory/CPU (GET /api/sfmc/status)
    online / 在线Online roster (truncated)
    绑定 / bindRequest bind code (needs platform BP host with QQ bind)
    解绑 / unbindUnbind
    申请入服 / joinRequest BDS allowlist entry (admin approve + module apply)
    频道 / channelChat-bridge channel + light db/BDS self-check
    管理 / adminAdmin submenu (admins only): doctor / group / events

    Admin commands are hidden from the main menu and official C2C quick menu. The bot no longer kicks players.

    • official: @bot then send the trigger; optional sync to custom menu / command panel (sync-menu console command). C2C messages also hit the command router. With interaction intent, approval uses callback buttons (INTERACTION_CREATE).
    • llbot: same triggers; numbered replies within 60s; no native panel / INTERACTION — use 通过/拒绝 <id>.
    • Non-command group messages enter the game's read-only qq channel.
    • status: world day and difficulty on separate lines; official adds a QQ group summary when APIs allow.

    In-game chat bridge

    The chat module creates a read-only qq channel for incoming group messages. Players, including administrators, cannot speak in it.

    DirectionBehavior
    QQ → gameOfficial: only @bot non-command messages are stored in the qq channel; the chat module displays them to subscribers
    Game → QQThe source channel's “Forward to QQ” switch controls forwarding; enabled channels use their own channel prefix

    LLBot outbound chat still needs HTTP (default 3004).

    Check: configure + restart → @bot hello appears in game → game chat appears in QQ → 频道 / channel shows whether set.

    QQ↔MC binding

    Platform APIs on db-server (loopback): POST /api/sfmc/qq/bind/{request,confirm,unbind} and GET /api/sfmc/qq/bind/me.

    Join approval & dual admin sides

    SideCapabilityWhere
    QQRequest/approve/pending, group info/bot_state, notifyqq-bridge + OpenAPI; state in db-server
    BDSBind gate, join/leave/death reportsPlatform behavior-pack host (installHostBootstrap)

    The platform never writes BDS allowlist.json directly. QQ bot management does not enqueue kicks. Chat between the game and QQ is owned by the chat module (forward_to_qq and QQ-sourced channels), not a removed bridge_channel_id setting.

    MethodPathPurpose
    POST/api/sfmc/qq/join/requestApply
    POST/api/sfmc/qq/join/decideApprove/reject (official.admin_openids)
    GET/api/sfmc/qq/join/pendingPending
    GET/api/sfmc/qq/join/apply-queueSAPI pulls approved-not-applied
    POST/api/sfmc/qq/join/appliedSAPI ack

    If BDS is down, approvals can queue and apply after restart. Stopping BDS does not block read-only 群信息 (OpenAPI only).

    Join switches (platform config configs/qq_link.json)

    Owned by the platform QQ bind host, not the SDK / qq_config. Defaults are created on first read/write (wizard / db-server seed):

    KeyDefaultMeaning
    allowlist_enabledtrueMaster switch; off = no new requests and empty apply-queue
    require_approvaltrueOff = auto-approved into the apply queue
    treat_group_admins_as_adminstrueTreat QQ group owner/admins as SFMC admins; file-only write, readable via bot/API

    Bot (official.admin_openids, or group admins when the flag above is on): 配置 opens a button panel (official INTERACTION / llbot numbers); text 配置 白名单|审批 开|关 still works. API: GET/POST /api/sfmc/qq/join/settings (POST cannot change treat_group_admins_as_admins).

    Group OpenAPI allowlist (error 11253)

    GET /v2/groups/{group_openid}/info and bot_state may require a platform allowlist. When blocked, status / 群信息 show a clear tip; chat bridge and join flow still work.

    Game side is built into the platform behavior-pack host (same pattern as runtime monitoring): /c:bind, the unbound visitor gate, and join/leave/death reporting. Rebuild/deploy the platform BP after SDK upgrades. qq-link / feature-qq-link are retired modules — CLI refuses install/enable.

    Read-only ops: public GET /api/sfmc/status backs status / online. Payload includes host (uptime/memory/CPU) and processes.bds / processes.db (process uptime; BDS from .sfmc/bds.pid or bedrock_server probe).

    Event push

    Join / leave / death / BDS lifecycle posts to the QQ group independently of chat forwarding. Every event is sent immediately as its own message; nothing is batched.

    EventSourceWhen
    Join / leave / deathPlatform BP host (SAPI)Immediate
    BDS unexpected exitbds-manager (not manual stop)Immediate
    BDS start successbds-manager after spawnImmediate

    Outbound still goes db-server → official OpenAPI / LLBot HTTP (same as MC→QQ; llbot needs port 3004). Official proactive group messages are rate-limited by QQ; turn off noisy event types if the group gets throttled.

    Config (qq_config.json → qq_events; restart db-server after edits). The legacy window_sec field is deprecated and ignored:

    "qq_events": {
      "enabled": true,
      "join": true,
      "leave": true,
      "death": true,
      "crash": true,
      "start": true
    }

    enabled: false disables all. API: POST /api/sfmc/qq/events (loopback; one object or { "events": [...] }, max 100).

    Manual stop does not emit crash; crash auto-restart emits crash then start. Not in scope: achievements, chat mirroring via this path.

    Start

    sfmc> start db
    sfmc> start qq
    # or
    sfmc> start -all

    Recommended order: db, then qq (llbot is started only for the llbot backend when enabled), then bds. See Service management.

    Loop prevention

    • Drop messages from the bot itself
    • Dedupe identical message ids within ~5 seconds

    Troubleshooting: Troubleshooting.