From 021b7cf409f8e4565a8b1bf60918834cdded62b8 Mon Sep 17 00:00:00 2001 From: mileusna Date: Fri, 21 Jul 2017 16:42:28 +0200 Subject: [PATCH] Bug-fix, add mandatory Type property --- keyboard.go | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/keyboard.go b/keyboard.go index 73cedc0..0d466d4 100644 --- a/keyboard.go +++ b/keyboard.go @@ -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"` } @@ -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, }