{"record":{"id":"3b49d86361a9f9a0","repo":"sipeed/picoclaw","slug":"failed-to-send-message-w","errorCode":null,"errorMessage":"failed to send message: %w","messagePattern":"failed to send message: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/vk/vk.go","lineNumber":237,"sourceCode":"\n\t\tb := params.NewMessagesSendBuilder()\n\t\tb.Message(chunk)\n\t\tb.RandomID(0)\n\t\tb.PeerID(peerID)\n\n\t\tif msg.ReplyToMessageID != \"\" {\n\t\t\tif replyID, err := strconv.Atoi(msg.ReplyToMessageID); err == nil {\n\t\t\t\tb.ReplyTo(replyID)\n\t\t\t}\n\t\t}\n\n\t\tresp, err := c.vk.MessagesSend(b.Params)\n\t\tif err != nil {\n\t\t\tlogger.ErrorCF(\"vk\", \"Failed to send message\", map[string]any{\n\t\t\t\t\"error\":   err.Error(),\n\t\t\t\t\"peer_id\": peerID,\n\t\t\t})\n\t\t\treturn messageIDs, fmt.Errorf(\"failed to send message: %w\", err)\n\t\t}\n\n\t\tmessageIDs = append(messageIDs, strconv.Itoa(resp))\n\t}\n\n\treturn messageIDs, nil\n}\n\nfunc (c *VKChannel) isMentioned(msg object.MessagesMessage) bool {\n\treturn false\n}\n\nfunc (c *VKChannel) stripBotMention(text string) string {\n\treturn strings.TrimSpace(text)\n}\n\nfunc (c *VKChannel) getUserName(userID int) string {\n\tusers, err := c.vk.UsersGet(api.Params{","sourceCodeStart":219,"sourceCodeEnd":255,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/vk/vk.go#L219-L255","documentation":"Returned by VKChannel.Send when c.vk.MessagesSend fails for a message chunk — a VK API or transport error, logged with the peer ID before returning. Note earlier chunks in the same send may already have been delivered; messageIDs accumulated so far are returned alongside the error.","triggerScenarios":"Thrown at pkg/channels/vk/vk.go:237 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the logged VK API error (rate limit, peer blocked, token scope)","Retry the send, deduplicating if the receiving side may have gotten earlier chunks","Verify the bot is not blocked by the peer and has messaging permission for that chat"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"49183d7e8daed0dba89ddbb6fcb60089401d9680","analyzedAt":"2026-08-15T21:55:41.315Z","contentChangedAt":"2026-08-15T21:55:41.315Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}