bbgo_origin/pkg/interact/reply.go

63 lines
1.3 KiB
Go
Raw Normal View History

2022-01-14 03:43:27 +00:00
package interact
2022-01-19 05:07:25 +00:00
type Button struct {
Text string
Name string
Value string
}
type TextField struct {
// Name is the form field name
Name string
// Label is the field label
Label string
// PlaceHolder is the sample text in the text input
PlaceHolder string
}
type Option struct {
// Name is the form field name
2022-01-19 05:07:25 +00:00
Name string
// Label is the option label for display
Label string
// Value is the option value
2022-01-19 05:07:25 +00:00
Value string
}
2022-01-14 03:43:27 +00:00
type Reply interface {
2022-01-19 05:07:25 +00:00
// Send sends the message directly to the client's session
2022-01-14 18:52:46 +00:00
Send(message string)
2022-01-19 05:07:25 +00:00
// Message sets the message to the reply
2022-01-14 03:43:27 +00:00
Message(message string)
2022-01-19 05:07:25 +00:00
// AddButton adds the button to the reply
AddButton(text string, name, value string)
InputText(prompt string, textFields ...TextField)
Choose(prompt string, options ...Option)
// Confirm shows the confirm dialog or confirm button in the user interface
// Confirm(prompt string)
2022-01-19 05:07:25 +00:00
// RemoveKeyboard hides the keyboard from the client user interface
2022-01-14 03:43:27 +00:00
RemoveKeyboard()
}
2022-01-19 05:07:25 +00:00
// ButtonReply can be used if your reply needs button user interface.
type ButtonReply interface {
// AddButton adds the button to the reply
AddButton(text string)
}
// DialogReply can be used if your reply needs Dialog user interface
type DialogReply interface {
// AddButton adds the button to the reply
Dialog(title, text string, buttons []string)
}