fix: lint cleanup and document group_trigger in example config
Add group_trigger entries to all channels in config.example.json that support mention-only mode. Fix golines formatting in line.go, matrix.go, config.go, and suppress nilerr for intentional silent skip in observeMessage. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
3bd90a2212
commit
556d236c46
5 changed files with 37 additions and 9 deletions
|
|
@ -95,6 +95,9 @@
|
|||
"proxy": "",
|
||||
"allow_from": ["YOUR_USER_ID"],
|
||||
"use_markdown_v2": false,
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"reasoning_channel_id": "",
|
||||
"streaming": {
|
||||
"enabled": true
|
||||
|
|
@ -115,6 +118,9 @@
|
|||
"app_id": "YOUR_QQ_APP_ID",
|
||||
"app_secret": "YOUR_QQ_APP_SECRET",
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"reasoning_channel_id": ""
|
||||
},
|
||||
"maixcam": {
|
||||
|
|
@ -130,6 +136,9 @@
|
|||
"use_native": false,
|
||||
"session_store_path": "",
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": false
|
||||
},
|
||||
"reasoning_channel_id": ""
|
||||
},
|
||||
"feishu": {
|
||||
|
|
@ -139,6 +148,9 @@
|
|||
"encrypt_key": "",
|
||||
"verification_token": "",
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"placeholder": {
|
||||
"enabled": true,
|
||||
"text": ["Thinking...", "Processing...", "Typing..."]
|
||||
|
|
@ -152,6 +164,9 @@
|
|||
"client_id": "YOUR_CLIENT_ID",
|
||||
"client_secret": "YOUR_CLIENT_SECRET",
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"reasoning_channel_id": ""
|
||||
},
|
||||
"slack": {
|
||||
|
|
@ -159,6 +174,9 @@
|
|||
"bot_token": "xoxb-YOUR-BOT-TOKEN",
|
||||
"app_token": "xapp-YOUR-APP-TOKEN",
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"reasoning_channel_id": ""
|
||||
},
|
||||
"matrix": {
|
||||
|
|
@ -186,6 +204,9 @@
|
|||
"channel_access_token": "YOUR_LINE_CHANNEL_ACCESS_TOKEN",
|
||||
"webhook_path": "/webhook/line",
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"reasoning_channel_id": ""
|
||||
},
|
||||
"onebot": {
|
||||
|
|
@ -195,6 +216,9 @@
|
|||
"reconnect_interval": 5,
|
||||
"group_trigger_prefix": [],
|
||||
"allow_from": [],
|
||||
"group_trigger": {
|
||||
"mention_only": true
|
||||
},
|
||||
"reasoning_channel_id": ""
|
||||
},
|
||||
"wecom": {
|
||||
|
|
|
|||
|
|
@ -1448,7 +1448,7 @@ func (al *AgentLoop) observeMessage(ctx context.Context, msg bus.InboundMessage)
|
|||
"channel": msg.Channel,
|
||||
"error": err.Error(),
|
||||
})
|
||||
return "", nil
|
||||
return "", nil //nolint:nilerr // route resolution failure is not an error for observe-only messages
|
||||
}
|
||||
|
||||
sessionKey := resolveScopeKey(route, msg.SessionKey)
|
||||
|
|
|
|||
|
|
@ -367,7 +367,9 @@ func (c *LINEChannel) processEvent(event lineEvent) {
|
|||
"platform": "line",
|
||||
"source_type": event.Source.Type,
|
||||
}
|
||||
c.ObserveGroupMessage(c.ctx, observePeer, msg.ID, senderID, chatID, content, mediaPaths, observeMeta, observeSender)
|
||||
c.ObserveGroupMessage(
|
||||
c.ctx, observePeer, msg.ID, senderID, chatID, content, mediaPaths, observeMeta, observeSender,
|
||||
)
|
||||
return
|
||||
}
|
||||
content = cleaned
|
||||
|
|
|
|||
|
|
@ -728,7 +728,9 @@ func (c *MatrixChannel) handleMessageEvent(ctx context.Context, evt *event.Event
|
|||
"room_id": roomID,
|
||||
"platform": "matrix",
|
||||
}
|
||||
c.ObserveGroupMessage(ctx, observePeer, evt.ID.String(), senderID, roomID, content, mediaPaths, observeMeta, sender)
|
||||
c.ObserveGroupMessage(
|
||||
ctx, observePeer, evt.ID.String(), senderID, roomID, content, mediaPaths, observeMeta, sender,
|
||||
)
|
||||
return
|
||||
}
|
||||
content = cleaned
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue