Skip to content

GOWA - WhatsApp REST API with support for UI, Multi Account, Webhooks, and MCP, and Chatwoot. Built with Golang for efficient memory use.

feat: add send file caption (#49)

Aldino Kemal3d5ffc96c31a
diff --git a/src/domains/send/file.go b/src/domains/send/file.go
index 5e553475..e3ba76a2 100644
--- a/src/domains/send/file.go
+++ b/src/domains/send/file.go
@@ -3,8 +3,9 @@ package send
import "mime/multipart"
type FileRequest struct {
- Phone string `json:"phone" form:"phone"`
- File *multipart.FileHeader `json:"file" form:"file"`
+ Phone string `json:"phone" form:"phone"`
+ File *multipart.FileHeader `json:"file" form:"file"`
+ Caption string `json:"caption" form:"caption"`
}
type FileResponse struct {
diff --git a/src/services/send.go b/src/services/send.go
index eae34d4f..0b1f2ea2 100644
--- a/src/services/send.go
+++ b/src/services/send.go
@@ -189,6 +189,7 @@ func (service serviceSend) SendFile(ctx context.Context, request domainSend.File
FileName: proto.String(request.File.Filename),
FileEncSha256: uploadedFile.FileEncSHA256,
DirectPath: proto.String(uploadedFile.DirectPath),
+ Caption: proto.String(request.Caption),
}}
ts, err := service.WaCli.SendMessage(ctx, dataWaRecipient, msgId, msg)
go func() {