sipeed/picoclaw · error · channels.ErrTemporary

onebot send media: %w

Error message

onebot send media: %w

What it means

Error "onebot send media: %w" thrown in sipeed/picoclaw.

Source

Thrown at pkg/channels/onebot/onebot.go:558

		Echo:   echo,
	}

	data, err := json.Marshal(req)
	if err != nil {
		return nil, fmt.Errorf("failed to marshal OneBot request: %w", err)
	}

	c.writeMu.Lock()
	_ = conn.SetWriteDeadline(time.Now().Add(10 * time.Second))
	err = conn.WriteMessage(websocket.TextMessage, data)
	_ = conn.SetWriteDeadline(time.Time{})
	c.writeMu.Unlock()

	if err != nil {
		logger.ErrorCF("onebot", "Failed to send media message", map[string]any{
			"error": err.Error(),
		})
		return nil, fmt.Errorf("onebot send media: %w", channels.ErrTemporary)
	}

	return nil, nil
}

func (c *OneBotChannel) buildMessageSegments(chatID, content string) []oneBotMessageSegment {
	var segments []oneBotMessageSegment

	if lastMsgID, ok := c.lastMessageID.Load(chatID); ok {
		if msgID, ok := lastMsgID.(string); ok && msgID != "" {
			segments = append(segments, oneBotMessageSegment{
				Type: "reply",
				Data: map[string]any{"id": msgID},
			})
		}
	}

	segments = append(segments, oneBotMessageSegment{

View on GitHub (pinned to 49183d7e8d)

When it happens

Trigger: Thrown at pkg/channels/onebot/onebot.go:558 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of sipeed/picoclaw@49183d7e8d (2026-08-15). Data as JSON: /api/errors/9013acc101876919. Report an issue: GitHub.