mirror of
https://github.com/tiennm99/goclaw.git
synced 2026-10-17 10:14:23 +00:00
fix(cron): deliver agent response instead of raw payload message
This commit is contained in:
1 parent
1f8bcbb559
commit
08ca343972
1 file changed
+2
-3
+2
-3
@@ -62,13 +62,12 @@ func makeCronJobHandler(sched *scheduler.Scheduler, msgBus *bus.MessageBus, cfg
|
||||
|
||||
result := outcome.Result
|
||||
|
||||
// If job wants delivery to a channel, send the cron reminder message
|
||||
// directly (not the agent response) so it appears as a bot notification.
|
||||
// If job wants delivery to a channel, send the agent response to the target chat.
|
||||
if job.Payload.Deliver && job.Payload.Channel != "" && job.Payload.To != "" {
|
||||
outMsg := bus.OutboundMessage{
|
||||
Channel: job.Payload.Channel,
|
||||
ChatID: job.Payload.To,
|
||||
Content: job.Payload.Message,
|
||||
Content: result.Content,
|
||||
}
|
||||
if peerKind == "group" {
|
||||
outMsg.Metadata = map[string]string{"group_id": job.Payload.To}
|
||||
|
||||
Reference in new issue
Block a user