mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
interact: add AddMultipleButtons function
This commit is contained in:
parent
5eef2a2085
commit
e122c12eef
|
@ -38,6 +38,9 @@ type Reply interface {
|
||||||
// AddButton adds the button to the reply
|
// AddButton adds the button to the reply
|
||||||
AddButton(text string, name, value string)
|
AddButton(text string, name, value string)
|
||||||
|
|
||||||
|
// AddMultipleButtons adds multiple buttons to the reply
|
||||||
|
AddMultipleButtons(buttonsForm [][3]string)
|
||||||
|
|
||||||
// Choose(prompt string, options ...Option)
|
// Choose(prompt string, options ...Option)
|
||||||
// Confirm shows the confirm dialog or confirm button in the user interface
|
// Confirm shows the confirm dialog or confirm button in the user interface
|
||||||
// Confirm(prompt string)
|
// Confirm(prompt string)
|
||||||
|
|
|
@ -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{} {
|
func (reply *SlackReply) build() interface{} {
|
||||||
// you should avoid using this modal view request, because it interrupts the interaction flow
|
// 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.
|
// once we send the modal view request, we can't go back to the channel.
|
||||||
|
|
|
@ -81,6 +81,12 @@ func (r *TelegramReply) AddButton(text string, name string, value string) {
|
||||||
r.set = true
|
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() {
|
func (r *TelegramReply) build() {
|
||||||
var rows []telebot.Row
|
var rows []telebot.Row
|
||||||
for _, button := range r.buttons {
|
for _, button := range r.buttons {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user