Skip to main content

QQ Bot

This is a shipped runtime-backed surface: direct sends are implemented, the reply-loop runtime is implemented, and Loong owns the QQ gateway session directly through channels serve qqbot.

At A Glance

FieldValue
Catalog idqqbot
Config keyqqbot
Implementation statusruntime_backed
Transportqq_official_bot_gateway_or_plugin_bridge
Aliasesqq, qq-bot, tencent-qq
Default send target kindconversation
Runtime ownergateway run or direct channels serve qqbot

Minimal Config

[qqbot]
enabled = true
app_id_env = "QQBOT_APP_ID"
client_secret_env = "QQBOT_CLIENT_SECRET"
allowed_peer_ids = ["openid_alice"]

Smoke Test

loong channels send qqbot --target "c2c:openid_alice" --text "hello from loong"
loong channels serve qqbot
What success looks like:
  • QQ Bot [qqbot] appears in the gateway-supervised runtime set
  • channels serve qqbot starts a native Loong-owned runtime instead of a managed plugin selection flow
  • doctor keeps direct send / serve readiness checks visible and actionable

Current Command Surface

OperationCurrent pathUsage or status
sendchannels send qqbotexecutes directly against the QQ gateway contract; target contract stays qqbot:<account>:c2c:<openid>, qqbot:<account>:group:<openid>, or qqbot:<account>:channel:<id>
servechannels serve qqbotstarts the native Loong-owned QQ gateway reply loop
health checkloong doctorcurrent readiness and remediation surface
inventoryloong channelscurrent operator inventory surface

Required Fields For Send

RequirementConfig pathsEnv pointer pathsDefault env
channel enabledqqbot.enabled
qqbot.accounts.<account>.enabled
nonenone
qq bot app idqqbot.app_id
qqbot.accounts.<account>.app_id
qqbot.app_id_env
qqbot.accounts.<account>.app_id_env
QQBOT_APP_ID
qq bot client secretqqbot.client_secret
qqbot.accounts.<account>.client_secret
qqbot.client_secret_env
qqbot.accounts.<account>.client_secret_env
QQBOT_CLIENT_SECRET

Required Fields For Serve

RequirementConfig pathsEnv pointer pathsDefault env
channel enabledqqbot.enabled
qqbot.accounts.<account>.enabled
nonenone
qq bot app idqqbot.app_id
qqbot.accounts.<account>.app_id
qqbot.app_id_env
qqbot.accounts.<account>.app_id_env
QQBOT_APP_ID
qq bot client secretqqbot.client_secret
qqbot.accounts.<account>.client_secret
qqbot.client_secret_env
qqbot.accounts.<account>.client_secret_env
QQBOT_CLIENT_SECRET
allowed peer idsqqbot.allowed_peer_ids
qqbot.accounts.<account>.allowed_peer_ids
nonenone

Stable Target Templates

TargetMeaning
qqbot:<account>:c2c:<openid>direct message openid
qqbot:<account>:group:<openid>group openid
qqbot:<account>:channel:<id>guild channel id

Account Scope Note

QQ Bot openids are scoped to the selected account. Keep account ids stable so route meaning does not drift when you rotate gateway credentials or bridge implementations.

Runtime Notes

  • QQ Bot no longer depends on managed bridge discovery for its main shipped runtime path.
  • The native runtime uses the configured QQ gateway credentials directly.

Gateway And Ownership

This surface can run directly through channels serve qqbot, or under Gateway And Supervision when the QQ Bot lane should join a larger supervised runtime set.

Operator Notes

  • Keep allowed_peer_ids explicit and narrow.
  • Loong validates allowed_peer_ids locally before forwarding a QQ send, so a mistyped openid is rejected before it reaches the upstream gateway.
  • channels serve qqbot owns the runtime loop directly; failures belong to the native runtime path instead of an external managed-plugin selection layer.
  • Treat QQ Bot as a multi-account surface from the start if you expect separate direct, group, or guild identities.
  • Continue to Weixin for the WeChat bridge-first lane.
  • Continue to OneBot when the upstream bridge already speaks OneBot v11.
  • Continue to Gateway And Supervision when QQ Bot should join a longer-lived supervised runtime.
  • Continue to Channel Setup for the shared public setup contract.