Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 19 additions & 4 deletions keyboard.go
Original file line number Diff line number Diff line change
@@ -1,18 +1,33 @@
package viber

type InputFieldStateType string

// InputFieldState Values
const (
RegularState = InputFieldStateType("regular")
MinimizedState = InputFieldStateType("minimized")
HiddenState = InputFieldStateType("hidden")
)

// Keyboard struct
type Keyboard struct {
Type string `json:"Type"`
DefaultHeight bool `json:"DefaultHeight,omitempty"`
BgColor string `json:"BgColor,omitempty"`
Buttons []Button `json:"Buttons"`
Type string `json:"Type"`
DefaultHeight bool `json:"DefaultHeight,omitempty"`
BgColor string `json:"BgColor,omitempty"`
Buttons []Button `json:"Buttons"`
InputFieldState InputFieldStateType `json:"InputFieldState,omitempty"`
}

// AddButton to keyboard
func (k *Keyboard) AddButton(b *Button) {
k.Buttons = append(k.Buttons, *b)
}

func (k *Keyboard) SetInputFieldState(state InputFieldStateType) *Keyboard {
k.InputFieldState = state
return k
}

// NewKeyboard struct with attribs init
func (v *Viber) NewKeyboard(bgcolor string, defaultHeight bool) *Keyboard {
return &Keyboard{
Expand Down