changeset 19:a9d6fa80e7dc

Fix inline keyboard for when no buttons are offered
author Lewin Bormann <lbo@spheniscida.de>
date Fri, 09 Dec 2016 22:26:38 +0100
parents 02dba5e5265e
children 851d4eaa877e
files handlers.go
diffstat 1 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/handlers.go	Fri Dec 09 22:14:12 2016 +0100
+++ b/handlers.go	Fri Dec 09 22:26:38 2016 +0100
@@ -109,10 +109,15 @@
 	}
 
 	reply := sendMessage{
-		Chat_ID:      msg.Chat.ID,
-		Parse_Mode:   "Markdown",
-		Text:         rp.text,
-		Reply_Markup: rp.buttons,
+		Chat_ID:    msg.Chat.ID,
+		Parse_Mode: "Markdown",
+		Text:       rp.text,
+	}
+
+	if rp.buttons.Inline_Keyboard != nil {
+		reply.Reply_Markup = rp.buttons
+	} else {
+		reply.Reply_Markup = inlineKeyboardMarkup{Inline_Keyboard: [][]inlineKeyboardButton{}}
 	}
 
 	return reply, err