diff options
Diffstat (limited to 'vendor/github.com/nlopes/slack/chat.go')
-rw-r--r-- | vendor/github.com/nlopes/slack/chat.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/github.com/nlopes/slack/chat.go b/vendor/github.com/nlopes/slack/chat.go index a480e5a7..c0744842 100644 --- a/vendor/github.com/nlopes/slack/chat.go +++ b/vendor/github.com/nlopes/slack/chat.go @@ -228,6 +228,7 @@ type sendConfig struct { endpoint string values url.Values attachments []Attachment + blocks Blocks responseType string } @@ -242,6 +243,7 @@ func (t sendConfig) BuildRequest(token, channelID string) (req *http.Request, _ endpoint: t.endpoint, values: t.values, attachments: t.attachments, + blocks: t.blocks, responseType: t.responseType, }.BuildRequest() default: @@ -265,6 +267,7 @@ type responseURLSender struct { endpoint string values url.Values attachments []Attachment + blocks Blocks responseType string } @@ -273,6 +276,7 @@ func (t responseURLSender) BuildRequest() (*http.Request, func(*chatResponseFull Text: t.values.Get("text"), Timestamp: t.values.Get("ts"), Attachments: t.attachments, + Blocks: t.blocks, ResponseType: t.responseType, }) return req, func(resp *chatResponseFull) responseParser { @@ -420,6 +424,8 @@ func MsgOptionBlocks(blocks ...Block) MsgOption { return nil } + config.blocks.BlockSet = append(config.blocks.BlockSet, blocks...) + blocks, err := json.Marshal(blocks) if err == nil { config.values.Set("blocks", string(blocks)) |