From 23d8742f0d95096b92f11729fb47f86ac3b68d43 Mon Sep 17 00:00:00 2001 From: Wim Date: Sat, 18 Jul 2020 17:27:41 +0200 Subject: Update dependencies for 1.18.0 release (#1175) --- vendor/github.com/slack-go/slack/block_conv.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'vendor/github.com/slack-go/slack/block_conv.go') diff --git a/vendor/github.com/slack-go/slack/block_conv.go b/vendor/github.com/slack-go/slack/block_conv.go index 00d59c3b..3fda5431 100644 --- a/vendor/github.com/slack-go/slack/block_conv.go +++ b/vendor/github.com/slack-go/slack/block_conv.go @@ -2,6 +2,7 @@ package slack import ( "encoding/json" + "fmt" "github.com/pkg/errors" ) @@ -172,10 +173,12 @@ func (b *BlockElements) UnmarshalJSON(data []byte) error { blockElement = &DatePickerBlockElement{} case "plain_text_input": blockElement = &PlainTextInputBlockElement{} + case "checkboxes": + blockElement = &CheckboxGroupsBlockElement{} case "static_select", "external_select", "users_select", "conversations_select", "channels_select": blockElement = &SelectBlockElement{} default: - return errors.New("unsupported block element type") + return fmt.Errorf("unsupported block element type %v", blockElementType) } err = json.Unmarshal(r, blockElement) @@ -275,6 +278,12 @@ func (a *Accessory) UnmarshalJSON(data []byte) error { return err } a.MultiSelectElement = element.(*MultiSelectBlockElement) + case "checkboxes": + element, err := unmarshalBlockElement(r, &CheckboxGroupsBlockElement{}) + if err != nil { + return err + } + a.CheckboxGroupsBlockElement = element.(*CheckboxGroupsBlockElement) default: element, err := unmarshalBlockElement(r, &UnknownBlockElement{}) if err != nil { @@ -313,6 +322,9 @@ func toBlockElement(element *Accessory) BlockElement { if element.RadioButtonsElement != nil { return element.RadioButtonsElement } + if element.CheckboxGroupsBlockElement != nil { + return element.CheckboxGroupsBlockElement + } if element.SelectElement != nil { return element.SelectElement } -- cgit v1.2.3