diff --git a/go.mod b/go.mod new file mode 100644 index 0000000..11f974d --- /dev/null +++ b/go.mod @@ -0,0 +1,7 @@ +module github.com/paked/messenger + +require ( + github.com/davecgh/go-spew v1.1.1 // indirect + github.com/pmezard/go-difflib v1.0.0 // indirect + github.com/stretchr/testify v1.2.2 +) diff --git a/response.go b/response.go index 4411761..20e243c 100644 --- a/response.go +++ b/response.go @@ -87,6 +87,11 @@ type Response struct { to Recipient } +// SetToken is for using DispatchMessage from outside. +func (r *Response) SetToken(token string) { + r.token = token +} + // Text sends a textual message. func (r *Response) Text(message string, messagingType MessagingType, tags ...string) error { return r.TextWithReplies(message, nil, messagingType, tags...) @@ -368,7 +373,7 @@ type StructuredMessagePayload struct { type StructuredMessageElement struct { Title string `json:"title"` ImageURL string `json:"image_url"` - ItemURL string `json:"item_url"` + ItemURL string `json:"item_url,omitempty"` Subtitle string `json:"subtitle"` DefaultAction *DefaultAction `json:"default_action,omitempty"` Buttons []StructuredMessageButton `json:"buttons"`