{"record":{"id":"8fbbce98f49a3acf","repo":"sipeed/picoclaw","slug":"telegram-rewind-media-after-photo-failure-w","errorCode":null,"errorMessage":"telegram rewind media after photo failure: %w","messagePattern":"telegram rewind media after photo failure: %w","errorType":"exception","errorClass":"ErrTemporary","httpStatus":null,"severity":"error","filePath":"pkg/channels/telegram/telegram.go","lineNumber":705,"sourceCode":"\t\t\t\t\"error\": err.Error(),\n\t\t\t})\n\t\t\tcontinue\n\t\t}\n\n\t\tvar tgResult *telego.Message\n\t\tswitch part.Type {\n\t\tcase \"image\":\n\t\t\tparams := &telego.SendPhotoParams{\n\t\t\t\tChatID:          tu.ID(chatID),\n\t\t\t\tMessageThreadID: threadID,\n\t\t\t\tPhoto:           telego.InputFile{File: file},\n\t\t\t\tCaption:         part.Caption,\n\t\t\t}\n\t\t\ttgResult, err = c.bot.SendPhoto(ctx, params)\n\t\t\tif err != nil && strings.Contains(err.Error(), \"PHOTO_INVALID_DIMENSIONS\") {\n\t\t\t\tif _, seekErr := file.Seek(0, io.SeekStart); seekErr != nil {\n\t\t\t\t\tfile.Close()\n\t\t\t\t\treturn nil, fmt.Errorf(\"telegram rewind media after photo failure: %w\", channels.ErrTemporary)\n\t\t\t\t}\n\n\t\t\t\tdocParams := &telego.SendDocumentParams{\n\t\t\t\t\tChatID:          tu.ID(chatID),\n\t\t\t\t\tMessageThreadID: threadID,\n\t\t\t\t\tDocument:        telego.InputFile{File: file},\n\t\t\t\t\tCaption:         part.Caption,\n\t\t\t\t}\n\t\t\t\ttgResult, err = c.bot.SendDocument(ctx, docParams)\n\t\t\t}\n\t\tcase \"audio\":\n\t\t\t// Send OGG files with \"voice\" in the filename as Telegram voice\n\t\t\t// bubbles (SendVoice) instead of audio attachments (SendAudio).\n\t\t\tfn := strings.ToLower(part.Filename)\n\t\t\tif strings.Contains(fn, \"voice\") && (strings.HasSuffix(fn, \".ogg\") || strings.HasSuffix(fn, \".oga\")) {\n\t\t\t\tvparams := &telego.SendVoiceParams{\n\t\t\t\t\tChatID:          tu.ID(chatID),\n\t\t\t\t\tMessageThreadID: threadID,","sourceCodeStart":687,"sourceCodeEnd":723,"githubUrl":"https://github.com/sipeed/picoclaw/blob/49183d7e8daed0dba89ddbb6fcb60089401d9680/pkg/channels/telegram/telegram.go#L687-L723","documentation":"Error \"telegram rewind media after photo failure: %w\" thrown in sipeed/picoclaw.","triggerScenarios":"Thrown at pkg/channels/telegram/telegram.go:705 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"}