Skip to content
This repository was archived by the owner on Jul 3, 2024. It is now read-only.
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion SDK/message/card_builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ func (builder *CardBuilder) AddImageBlock(title *protocol.TextForm, alt protocol
}

// add action block
func (builder *CardBuilder) AddActionBlock(actions []protocol.ActionElement) *CardBuilder {
func (builder *CardBuilder) AddActionBlock(actions []protocol.ActionElement, layout string) *CardBuilder {
// generate a new session
if builder.Session == nil {
sid := uuid.New().String()
Expand All @@ -129,6 +129,8 @@ func (builder *CardBuilder) AddActionBlock(actions []protocol.ActionElement) *Ca
}
act.Actions = actions

act.Layout = layout

if builder.currentLocale != "" {
builder.i18nBlocks[builder.currentLocale] = append(builder.i18nBlocks[builder.currentLocale], act)
} else {
Expand Down
1 change: 1 addition & 0 deletions SDK/protocol/card_element.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@ type ImageBlockForm struct {
type ActionBlockForm struct {
Tag string `json:"tag,omitempty" validate:"omitempty"`
Actions []ActionElement `json:"actions,omitempty" validate:"omitempty"`
Layout string `json:"layout,omitempty" validate:"omitempty"`
}

// card block - note
Expand Down