diff --git a/SDK/message/card_builder.go b/SDK/message/card_builder.go index 008e160..3d1e17a 100644 --- a/SDK/message/card_builder.go +++ b/SDK/message/card_builder.go @@ -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() @@ -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 { diff --git a/SDK/protocol/card_element.go b/SDK/protocol/card_element.go index 2ecdee8..51a4962 100644 --- a/SDK/protocol/card_element.go +++ b/SDK/protocol/card_element.go @@ -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