diff --git a/attachments.go b/attachments.go index 3a368ca06..73cdebe6d 100644 --- a/attachments.go +++ b/attachments.go @@ -61,7 +61,7 @@ type ConfirmationField struct { // Attachment contains all the information for an attachment type Attachment struct { Color string `json:"color,omitempty"` - Fallback string `json:"fallback"` + Fallback string `json:"fallback,omitempty"` CallbackID string `json:"callback_id,omitempty"` ID int `json:"id,omitempty"` @@ -75,7 +75,7 @@ type Attachment struct { Title string `json:"title,omitempty"` TitleLink string `json:"title_link,omitempty"` Pretext string `json:"pretext,omitempty"` - Text string `json:"text"` + Text string `json:"text,omitempty"` ImageURL string `json:"image_url,omitempty"` ThumbURL string `json:"thumb_url,omitempty"` diff --git a/chat_test.go b/chat_test.go index 2e820622f..92e1e0415 100644 --- a/chat_test.go +++ b/chat_test.go @@ -97,12 +97,11 @@ func TestPostMessage(t *testing.T) { opt: []MsgOption{ MsgOptionAttachments( Attachment{ - Text: "text", Blocks: blocks, }), }, expected: url.Values{ - "attachments": []string{`[{"fallback":"","text":"text","blocks":` + blockStr + `}]`}, + "attachments": []string{`[{"blocks":` + blockStr + `}]`}, "channel": []string{"CXXX"}, "token": []string{"testing-token"}, },