diff --git a/pkg/interact/reply.go b/pkg/interact/reply.go index bd5ac5057..11ead2ff3 100644 --- a/pkg/interact/reply.go +++ b/pkg/interact/reply.go @@ -38,6 +38,9 @@ type Reply interface { // AddButton adds the button to the reply AddButton(text string, name, value string) + // AddMultipleButtons adds multiple buttons to the reply + AddMultipleButtons(buttonsForm [][3]string) + // Choose(prompt string, options ...Option) // Confirm shows the confirm dialog or confirm button in the user interface // Confirm(prompt string) diff --git a/pkg/interact/slack.go b/pkg/interact/slack.go index 1a4ad3310..a6ef167c8 100644 --- a/pkg/interact/slack.go +++ b/pkg/interact/slack.go @@ -68,6 +68,12 @@ func (reply *SlackReply) AddButton(text string, name string, value string) { }) } +func (reply *SlackReply) AddMultipleButtons(buttonsForm [][3]string) { + for _, buttonForm := range buttonsForm { + reply.AddButton(buttonForm[0], buttonForm[1], buttonForm[2]) + } +} + func (reply *SlackReply) build() interface{} { // you should avoid using this modal view request, because it interrupts the interaction flow // once we send the modal view request, we can't go back to the channel. diff --git a/pkg/interact/telegram.go b/pkg/interact/telegram.go index a1206afc1..4b1bb13fe 100644 --- a/pkg/interact/telegram.go +++ b/pkg/interact/telegram.go @@ -81,6 +81,12 @@ func (r *TelegramReply) AddButton(text string, name string, value string) { r.set = true } +func (r *TelegramReply) AddMultipleButtons(buttonsForm [][3]string) { + for _, buttonForm := range buttonsForm { + r.AddButton(buttonForm[0], buttonForm[1], buttonForm[2]) + } +} + func (r *TelegramReply) build() { var rows []telebot.Row for _, button := range r.buttons {