{"record":{"id":"9013acc101876919","repo":"sipeed/picoclaw","slug":"onebot-send-media-w","errorCode":null,"errorMessage":"onebot send media: %w","messagePattern":"onebot send media: %w","errorType":"console","errorClass":"channels.ErrTemporary","httpStatus":null,"severity":"error","filePath":"pkg/channels/onebot/onebot.go","lineNumber":558,"sourceCode":"\t\tEcho:   echo,\n\t}\n\n\tdata, err := json.Marshal(req)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to marshal OneBot request: %w\", err)\n\t}\n\n\tc.writeMu.Lock()\n\t_ = conn.SetWriteDeadline(time.Now().Add(10 * time.Second))\n\terr = conn.WriteMessage(websocket.TextMessage, data)\n\t_ = conn.SetWriteDeadline(time.Time{})\n\tc.writeMu.Unlock()\n\n\tif err != nil {\n\t\tlogger.ErrorCF(\"onebot\", \"Failed to send media message\", map[string]any{\n\t\t\t\"error\": err.Error(),\n\t\t})\n\t\treturn nil, fmt.Errorf(\"onebot send media: %w\", channels.ErrTemporary)\n\t}\n\n\treturn nil, nil\n}\n\nfunc (c *OneBotChannel) buildMessageSegments(chatID, content string) []oneBotMessageSegment {\n\tvar segments []oneBotMessageSegment\n\n\tif lastMsgID, ok := c.lastMessageID.Load(chatID); ok {\n\t\tif msgID, ok := lastMsgID.(string); ok && msgID != \"\" {\n\t\t\tsegments = append(segments, oneBotMessageSegment{\n\t\t\t\tType: \"reply\",\n\t\t\t\tData: map[string]any{\"id\": msgID},\n\t\t\t})\n\t\t}\n\t}\n\n\tsegments = append(segments, oneBotMessageSegment{","sourceCodeStart":540,"sourceCodeEnd":576,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/onebot/onebot.go#L540-L576","documentation":"Error \"onebot send media: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/onebot/onebot.go:558 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}