Skip to content

Commit

Permalink
Bug-fix, add mandatory Type property
Browse files Browse the repository at this point in the history
  • Loading branch information
mileusna committed Jul 21, 2017
1 parent 2adf5ba commit 021b7cf
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions keyboard.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,9 @@ package viber

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

Expand All @@ -15,6 +16,7 @@ func (k *Keyboard) AddButton(b *Button) {
// NewKeyboard struct with attribs init
func NewKeyboard(bgcolor string, defaultHeight bool) *Keyboard {
return &Keyboard{
Type: "keyboard",
DefaultHeight: defaultHeight,
BgColor: bgcolor,
}
Expand Down

0 comments on commit 021b7cf

Please sign in to comment.