summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/nlopes/slack/attachments.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2017-07-16 14:29:46 +0200
committerWim <wim@42.be>2017-07-16 14:29:46 +0200
commitaec5e3d77b6e480d04dd8773723de62416a94919 (patch)
tree57ab269e6c46e62e61db04a9ca6fbb55e736519f /vendor/github.com/nlopes/slack/attachments.go
parent335ddf8db543bf64522196e6928c3d10af64694c (diff)
downloadmatterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.gz
matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.tar.bz2
matterbridge-msglm-aec5e3d77b6e480d04dd8773723de62416a94919.zip
Update vendor (nlopes/slack)
Diffstat (limited to 'vendor/github.com/nlopes/slack/attachments.go')
-rw-r--r--vendor/github.com/nlopes/slack/attachments.go34
1 files changed, 26 insertions, 8 deletions
diff --git a/vendor/github.com/nlopes/slack/attachments.go b/vendor/github.com/nlopes/slack/attachments.go
index f7b81617..c5a66d96 100644
--- a/vendor/github.com/nlopes/slack/attachments.go
+++ b/vendor/github.com/nlopes/slack/attachments.go
@@ -10,16 +10,34 @@ type AttachmentField struct {
Short bool `json:"short"`
}
-// AttachmentAction is a button to be included in the attachment. Required when
-// using message buttons and otherwise not useful. A maximum of 5 actions may be
+// AttachmentAction is a button or menu to be included in the attachment. Required when
+// using message buttons or menus and otherwise not useful. A maximum of 5 actions may be
// provided per attachment.
type AttachmentAction struct {
- Name string `json:"name"` // Required.
- Text string `json:"text"` // Required.
- Style string `json:"style,omitempty"` // Optional. Allowed values: "default", "primary", "danger"
- Type string `json:"type"` // Required. Must be set to "button"
- Value string `json:"value,omitempty"` // Optional.
- Confirm *ConfirmationField `json:"confirm,omitempty"` // Optional.
+ Name string `json:"name"` // Required.
+ Text string `json:"text"` // Required.
+ Style string `json:"style,omitempty"` // Optional. Allowed values: "default", "primary", "danger".
+ Type string `json:"type"` // Required. Must be set to "button" or "select".
+ Value string `json:"value,omitempty"` // Optional.
+ DataSource string `json:"data_source,omitempty"` // Optional.
+ MinQueryLength int `json:"min_query_length,omitempty"` // Optional. Default value is 1.
+ Options []AttachmentActionOption `json:"options,omitempty"` // Optional. Maximum of 100 options can be provided in each menu.
+ SelectedOptions []AttachmentActionOption `json:"selected_options,omitempty"` // Optional. The first element of this array will be set as the pre-selected option for this menu.
+ OptionGroups []AttachmentActionOptionGroup `json:"option_groups,omitempty"` // Optional.
+ Confirm *ConfirmationField `json:"confirm,omitempty"` // Optional.
+}
+
+// AttachmentActionOption the individual option to appear in action menu.
+type AttachmentActionOption struct {
+ Text string `json:"text"` // Required.
+ Value string `json:"value"` // Required.
+ Description string `json:"description,omitempty"` // Optional. Up to 30 characters.
+}
+
+// AttachmentActionOptionGroup is a semi-hierarchal way to list available options to appear in action menu.
+type AttachmentActionOptionGroup struct {
+ Text string `json:"text"` // Required.
+ Options []AttachmentActionOption `json:"options"` // Required.
}
// AttachmentActionCallback is sent from Slack when a user clicks a button in an interactive message (aka AttachmentAction)