anna
Channels

QQ Bot

anna includes a QQ bot that connects via WebSocket (persistent connection, no public URL required).

Setup

  1. Register a QQ Bot at QQ Bot Platform
  2. Get your AppID and AppSecret from the bot dashboard
  3. Add credentials to ~/.anna/config.yaml:
channels:
  qq:
    app_id: "YOUR_APP_ID"
    app_secret: "YOUR_APP_SECRET"

Or via environment:

export ANNA_QQ_APP_ID="YOUR_APP_ID"
export ANNA_QQ_APP_SECRET="YOUR_APP_SECRET"
  1. Start the gateway:
anna gateway

The bot connects to QQ via WebSocket -- no public URL or webhook setup needed.

Streaming Responses

The bot uses QQ's native Stream API for progressive response delivery. As the LLM generates tokens, updates are sent in real time without editing previous messages.

Tool Indicators

During tool execution, the stream shows status with emoji indicators (same as Telegram):

ToolEmoji
bashlightning
readbook
writepencil
editwrench
searchmagnifying glass

Group Support

QQ group messages are received as @mention events (GROUP_AT_MESSAGE_CREATE). Configure behavior:

channels:
  qq:
    group_mode: "mention"    # Respond to @mentions (default)
    # group_mode: "always"   # Same as mention for QQ (AT events are always mentions)
    # group_mode: "disabled" # Ignore group messages entirely

Access Control

Restrict which QQ users can interact with the bot using OpenIDs:

channels:
  qq:
    allowed_ids:
      - "USER_OPEN_ID_1"

Leave empty to allow all users. Use the /whoami command to get your OpenID.

Image Support

Users can send images to the bot for analysis. The bot downloads image attachments, encodes them, and passes them to the AI model as multimodal content alongside any caption text.

Commands

Send these commands as text messages to the bot:

CommandDescription
/start or /helpWelcome and help
/newStart a fresh session
/compactCompress conversation history
/modelList available models
/model <number>Switch to model by number
/model <query>Filter models by name
/whoamiShow your user ID for config

Configuration Reference

FieldDescriptionDefault
app_idQQ Bot AppID(required)
app_secretQQ Bot AppSecret(required)
group_modeGroup behavior: mention, always, disabledmention
allowed_idsUser OpenIDs allowed (empty = all)[]

On this page