From 5c5c7038cd72447aa464dcf5408226ee8fe4ae41 Mon Sep 17 00:00:00 2001 From: Karl-Johan Grahn Date: Tue, 28 Sep 2021 20:58:56 +0200 Subject: [PATCH 1/2] Add Dispatch Action Config to InputBlock --- block_element.go | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/block_element.go b/block_element.go index bf0684408..e07de07d9 100644 --- a/block_element.go +++ b/block_element.go @@ -389,13 +389,18 @@ func NewTimePickerBlockElement(actionID string) *TimePickerBlockElement { // // More Information: https://api.slack.com/reference/block-kit/block-elements#input type PlainTextInputBlockElement struct { - Type MessageElementType `json:"type"` - ActionID string `json:"action_id,omitempty"` - Placeholder *TextBlockObject `json:"placeholder,omitempty"` - InitialValue string `json:"initial_value,omitempty"` - Multiline bool `json:"multiline,omitempty"` - MinLength int `json:"min_length,omitempty"` - MaxLength int `json:"max_length,omitempty"` + Type MessageElementType `json:"type"` + ActionID string `json:"action_id,omitempty"` + Placeholder *TextBlockObject `json:"placeholder,omitempty"` + InitialValue string `json:"initial_value,omitempty"` + Multiline bool `json:"multiline,omitempty"` + MinLength int `json:"min_length,omitempty"` + MaxLength int `json:"max_length,omitempty"` + DispatchActionConfig DispatchActionConfig `json:"dispatch_action_config,omitempty"` +} + +type DispatchActionConfig struct { + TriggerActionsOn []string `json:"trigger_actions_on,omitempty"` } // ElementType returns the type of the Element From 17f8331790458134403a92c17da2fa01c34bc801 Mon Sep 17 00:00:00 2001 From: Karl-Johan Grahn Date: Wed, 29 Sep 2021 09:25:22 +0200 Subject: [PATCH 2/2] use pointer --- block_element.go | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/block_element.go b/block_element.go index e07de07d9..21abb018a 100644 --- a/block_element.go +++ b/block_element.go @@ -389,14 +389,14 @@ func NewTimePickerBlockElement(actionID string) *TimePickerBlockElement { // // More Information: https://api.slack.com/reference/block-kit/block-elements#input type PlainTextInputBlockElement struct { - Type MessageElementType `json:"type"` - ActionID string `json:"action_id,omitempty"` - Placeholder *TextBlockObject `json:"placeholder,omitempty"` - InitialValue string `json:"initial_value,omitempty"` - Multiline bool `json:"multiline,omitempty"` - MinLength int `json:"min_length,omitempty"` - MaxLength int `json:"max_length,omitempty"` - DispatchActionConfig DispatchActionConfig `json:"dispatch_action_config,omitempty"` + Type MessageElementType `json:"type"` + ActionID string `json:"action_id,omitempty"` + Placeholder *TextBlockObject `json:"placeholder,omitempty"` + InitialValue string `json:"initial_value,omitempty"` + Multiline bool `json:"multiline,omitempty"` + MinLength int `json:"min_length,omitempty"` + MaxLength int `json:"max_length,omitempty"` + DispatchActionConfig *DispatchActionConfig `json:"dispatch_action_config,omitempty"` } type DispatchActionConfig struct {