{"record":{"id":"e14e97db38b4d43b","repo":"sipeed/picoclaw","slug":"group-id-is-required-for-vk-bot","errorCode":null,"errorMessage":"group_id is required for VK bot","messagePattern":"group_id is required for VK bot","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"pkg/channels/vk/vk.go","lineNumber":74,"sourceCode":"}\n\nfunc (c *VKChannel) getVKCfg() *config.VKSettings {\n\tvar v config.VKSettings\n\tif err := c.bc.Decode(&v); err != nil {\n\t\treturn nil\n\t}\n\treturn &v\n}\n\nfunc (c *VKChannel) Start(ctx context.Context) error {\n\tlogger.InfoC(\"vk\", \"Starting VK bot (Long Poll mode)...\")\n\n\tc.ctx, c.cancel = context.WithCancel(ctx)\n\n\tgroupID := c.getVKCfg().GroupID\n\tif groupID == 0 {\n\t\tc.cancel()\n\t\treturn fmt.Errorf(\"group_id is required for VK bot\")\n\t}\n\n\tlp, err := longpoll.NewLongPoll(c.vk, groupID)\n\tif err != nil {\n\t\tc.cancel()\n\t\treturn fmt.Errorf(\"failed to create long poll: %w\", err)\n\t}\n\tc.lp = lp\n\n\tlp.MessageNew(func(_ context.Context, obj events.MessageNewObject) {\n\t\tc.handleMessage(obj.Message)\n\t})\n\n\tc.SetRunning(true)\n\n\tlogger.InfoCF(\"vk\", \"VK bot connected\", map[string]any{\n\t\t\"group_id\": groupID,\n\t})","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/vk/vk.go#L56-L92","documentation":"Validation guard at the top of VKChannel.Start: after decoding the channel settings, GroupID is still zero. The VK long-poll API requires a group ID to subscribe to message events, so Start cancels its context and refuses to run.","triggerScenarios":"Thrown at pkg/channels/vk/vk.go:74 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Set group_id in the vk channel config to the numeric ID of your VK group","Confirm the settings key is spelled group_id and decodes into VKSettings correctly"],"exampleFix":null,"handlingStrategy":"validation","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"}