-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathblock_context_actions.go
More file actions
31 lines (27 loc) · 907 Bytes
/
block_context_actions.go
File metadata and controls
31 lines (27 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package slack
// ContextActionsBlock defines data that is used to hold interactive action elements.
//
// More Information: https://docs.slack.dev/reference/block-kit/blocks/context-actions-block/
type ContextActionsBlock struct {
Type MessageBlockType `json:"type"`
BlockID string `json:"block_id,omitempty"`
Elements *BlockElements `json:"elements"`
}
// BlockType returns the type of the block
func (s ContextActionsBlock) BlockType() MessageBlockType {
return s.Type
}
// ID returns the ID of the block
func (s ContextActionsBlock) ID() string {
return s.BlockID
}
// NewContextActionsBlock returns a new instance of a Context Actions Block
func NewContextActionsBlock(blockID string, elements ...BlockElement) *ContextActionsBlock {
return &ContextActionsBlock{
Type: MBTContextActions,
BlockID: blockID,
Elements: &BlockElements{
ElementSet: elements,
},
}
}