From 2473ad3d4e1513285ca18a676324ec79c37882d5 Mon Sep 17 00:00:00 2001 From: Leo Zhang Date: Tue, 12 Apr 2022 04:14:55 -0700 Subject: [PATCH] Add a fluent WithConfirm for buttons --- block_element.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/block_element.go b/block_element.go index 21abb018a..643529ff0 100644 --- a/block_element.go +++ b/block_element.go @@ -167,6 +167,12 @@ func (s *ButtonBlockElement) WithStyle(style Style) *ButtonBlockElement { return s } +// WithConfirm adds a confirmation dialogue to the button object and returns the modified ButtonBlockElement +func (s *ButtonBlockElement) WithConfirm(confirm *ConfirmationBlockObject) *ButtonBlockElement { + s.Confirm = confirm + return s +} + // NewButtonBlockElement returns an instance of a new button element to be used within a block func NewButtonBlockElement(actionID, value string, text *TextBlockObject) *ButtonBlockElement { return &ButtonBlockElement{