Skip to content

Trigger Configuration Triggers

Configure how users activate AI conversations.

Trigger Types

TypeDescriptionExample
at@mention the bot@bot hello
prefixCommand prefix#chat hello
keywordContains keywordai help me
randomRandom probabilityAny message (5% chance)
alwaysAlways respondEvery message

Configuration

Basic Config

yaml
trigger:
  # Private chat trigger
  private: always
  
  # Group chat trigger
  group: at
  
  # Command prefix (for prefix mode)
  prefix: "#chat"

Multiple Triggers

yaml
trigger:
  group:
    - at
    - prefix
  prefix: "#ai"
  keywords:
    - "帮我"
    - "请问"

Private Chat

ModeBehavior
alwaysRespond to all messages
prefixOnly respond to prefixed messages
noneDisable private chat

Group Chat

ModeBehavior
atRespond when @mentioned
prefixRespond to prefixed messages
keywordRespond when keywords detected
randomRandom chance to respond
atAllRespond to @all

At-Mention Detection Across Protocols

The at trigger in group chats covers the major protocols in apps/chat.js (checkTrigger), no extra configuration needed:

ProtocolDetection fieldsNotes
icqq / TRSS loadere.atBot + at segment qq / data.qqThe loader normalizes at mentions into e.atBot
QQBot officialat segment data.user_idOfficial events have no atBot field
Generic fallbacke.atme, at segment data.all (@all)@all counts as a mention

The bot ID comparison uses the chain e.self_id → e.bot.uin → e.bot.self_id → globalThis.Bot.uin with string-based soft comparison. A pure @mention with no text does not trigger a reply; if the cleaned text is empty but the original message was not, the original text is used.

Keyword Trigger

yaml
trigger:
  group: keyword
  keywords:
    - "ai"
    - "机器人"
    - "帮我"
  keywordMode: contains  # or "startsWith", "exact"

Random Trigger

yaml
trigger:
  group: random
  randomRate: 0.05  # 5% chance

Per-Group Override

yaml
groups:
  123456789:
    trigger:
      mode: prefix
      prefix: "#gpt"
  987654321:
    trigger:
      mode: at

Web Panel

Configure triggers visually:

  1. Go to Groups tab
  2. Select a group
  3. Configure trigger settings
  4. Save

Priority

When multiple triggers are enabled:

  1. Prefix trigger (highest)
  2. @mention trigger
  3. Keyword trigger
  4. Random trigger (lowest)

Next Steps

Released under the MIT License