From 05c759e17b1361dbc10c417dcc17ffd63a681bee Mon Sep 17 00:00:00 2001 From: Hamcha Date: Mon, 26 Aug 2019 12:44:40 +0200 Subject: [PATCH] Fix width/height of inline results --- main.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index ef463e7..21692dd 100644 --- a/main.go +++ b/main.go @@ -101,12 +101,16 @@ func webhook(update tg.APIUpdate) { ThumbURL: face, Title: card.FullName, Caption: caption, - Width: 672, - Height: 936, + Width: 344, + Height: 480, ReplyMarkup: &tg.APIInlineKeyboardMarkup{ InlineKeyboard: [][]tg.APIInlineKeyboardButton{buttons}, }, } + // Flip width/height for problems + if card.Type == "Problem" { + photos[i].Width, photos[i].Height = photos[i].Height, photos[i].Width + } } err = api.AnswerInlineQuery(tg.InlineQueryResponse{