1
0
mirror of synced 2024-11-25 14:26:09 +03:00

Merge pull request #53 from albttx/develop

WIP: Some modification
This commit is contained in:
Harrison Shoebridge 2019-01-02 16:07:19 +11:00 committed by GitHub
commit a812fd151f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 1 deletions

7
go.mod Normal file
View File

@ -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
)

View File

@ -87,6 +87,11 @@ type Response struct {
to Recipient to Recipient
} }
// SetToken is for using DispatchMessage from outside.
func (r *Response) SetToken(token string) {
r.token = token
}
// Text sends a textual message. // Text sends a textual message.
func (r *Response) Text(message string, messagingType MessagingType, tags ...string) error { func (r *Response) Text(message string, messagingType MessagingType, tags ...string) error {
return r.TextWithReplies(message, nil, messagingType, tags...) return r.TextWithReplies(message, nil, messagingType, tags...)
@ -368,7 +373,7 @@ type StructuredMessagePayload struct {
type StructuredMessageElement struct { type StructuredMessageElement struct {
Title string `json:"title"` Title string `json:"title"`
ImageURL string `json:"image_url"` ImageURL string `json:"image_url"`
ItemURL string `json:"item_url"` ItemURL string `json:"item_url,omitempty"`
Subtitle string `json:"subtitle"` Subtitle string `json:"subtitle"`
DefaultAction *DefaultAction `json:"default_action,omitempty"` DefaultAction *DefaultAction `json:"default_action,omitempty"`
Buttons []StructuredMessageButton `json:"buttons"` Buttons []StructuredMessageButton `json:"buttons"`