The Caption field in Domains->Send->File.go-> FileRequest is missing
type FileRequest struct {
Phone string json:"phone" form:"phone"
File *multipart.FileHeader json:"file" form:"file"
Caption string json:"caption" form:"caption" <------ should be added
}
along with its assignment
in service->send.go ->SendFile-> waProto.DocumentMessage at line number 182. A caption field should also be there in the waProto.DocumentMessage initialization.
A field Caption is already there in waProto.DocumentMessage which needs to be mapped to FileRequest.Caption
msg := &waProto.Message{DocumentMessage: &waProto.DocumentMessage{
Url: proto.String(uploadedFile.URL),
Mimetype: proto.String(http.DetectContentType(dataWaFile)),
Title: proto.String(request.File.Filename),
FileSha256: uploadedFile.FileSHA256,
FileLength: proto.Uint64(uploadedFile.FileLength),
MediaKey: uploadedFile.MediaKey,
FileName: proto.String(request.File.Filename),
FileEncSha256: uploadedFile.FileEncSHA256,
DirectPath: proto.String(uploadedFile.DirectPath),
Caption: proto.String(request.File.Caption), <------ should be added
}}