Skip to content

Commit

Permalink
Fix sending empty text messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Robi9 committed May 8, 2024
1 parent cff3d75 commit 20a327b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion handlers/facebookapp/facebookapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -1201,7 +1201,7 @@ type wacComponent struct {
}

type wacText struct {
Body string `json:"body"`
Body string `json:"body,omitempty"`
PreviewURL bool `json:"preview_url,omitempty"`
}

Expand Down
8 changes: 4 additions & 4 deletions handlers/whatsapp/whatsapp.go
Original file line number Diff line number Diff line change
Expand Up @@ -417,8 +417,8 @@ type mtTextPayload struct {
Type string `json:"type" validate:"required"`
PreviewURL bool `json:"preview_url,omitempty"`
Text struct {
Body string `json:"body" validate:"required"`
} `json:"text"`
Body string `json:"body,omitempty"`
} `json:"text,omitempty"`
}

type mtInteractivePayload struct {
Expand All @@ -434,8 +434,8 @@ type mtInteractivePayload struct {
Document string `json:"document,omitempty"`
} `json:"header,omitempty"`
Body struct {
Text string `json:"text"`
} `json:"body" validate:"required"`
Text string `json:"text,omitempty"`
} `json:"body,omitempty"`
Footer *struct {
Text string `json:"text"`
} `json:"footer,omitempty"`
Expand Down

0 comments on commit 20a327b

Please sign in to comment.