Update slack vendor to master (#958)

This commit is contained in:
Wim
2019-12-07 22:54:36 +01:00
committed by GitHub
parent 173a38a374
commit f43faf15f8
20 changed files with 263 additions and 60 deletions

View File

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