all repos — telegram-bot-api @ 67ab387694d0239a236cc24c4a467b739a831881

Golang bindings for the Telegram Bot API

Fix broken inline queries.
Syfaro syfaro@foxpaw.in
Sun, 17 Jan 2016 23:34:12 -0600
commit

67ab387694d0239a236cc24c4a467b739a831881

parent

baf170548c7ebc221cd82c3d1a121d8b218786ac

3 files changed, 17 insertions(+), 16 deletions(-)

jump to
M bot.gobot.go

@@ -483,5 +483,7 @@ return APIResponse{}, err

} v.Add("results", string(data)) + bot.debugLog("answerInlineQuery", v, nil) + return bot.MakeRequest("answerInlineQuery", v) }
M configs.goconfigs.go

@@ -510,9 +510,9 @@ }

// InlineConfig contains information on making an InlineQuery response. type InlineConfig struct { - InlineQueryID string `json:"inline_query_id"` - Results []InlineQueryResult `json:"results"` - CacheTime int `json:"cache_time"` - IsPersonal bool `json:"is_personal"` - NextOffset string `json:"next_offset"` + InlineQueryID string `json:"inline_query_id"` + Results []interface{} `json:"results"` + CacheTime int `json:"cache_time"` + IsPersonal bool `json:"is_personal"` + NextOffset string `json:"next_offset"` }
M types.gotypes.go

@@ -281,15 +281,10 @@ Query string `json:"query"`

Offset string `json:"offset"` } -// InlineQueryResult is the base type that all InlineQuery Results have. -type InlineQueryResult struct { - Type string `json:"type"` // required - ID string `json:"id"` // required -} - // InlineQueryResultArticle is an inline query response article. type InlineQueryResultArticle struct { - InlineQueryResult + Type string `json:"type"` // required + ID string `json:"id"` // required Title string `json:"title"` // required MessageText string `json:"message_text"` // required ParseMode string `json:"parse_mode"`

@@ -304,7 +299,8 @@ }

// InlineQueryResultPhoto is an inline query response photo. type InlineQueryResultPhoto struct { - InlineQueryResult + Type string `json:"type"` // required + ID string `json:"id"` // required URL string `json:"photo_url"` // required MimeType string `json:"mime_type"` Width int `json:"photo_width"`

@@ -320,7 +316,8 @@ }

// InlineQueryResultGIF is an inline query response GIF. type InlineQueryResultGIF struct { - InlineQueryResult + Type string `json:"type"` // required + ID string `json:"id"` // required URL string `json:"gif_url"` // required Width int `json:"gif_width"` Height int `json:"gif_height"`

@@ -334,7 +331,8 @@ }

// InlineQueryResultMPEG4GIF is an inline query response MPEG4 GIF. type InlineQueryResultMPEG4GIF struct { - InlineQueryResult + Type string `json:"type"` // required + ID string `json:"id"` // required URL string `json:"mpeg4_url"` // required Width int `json:"mpeg4_width"` Height int `json:"mpeg4_height"`

@@ -348,7 +346,8 @@ }

// InlineQueryResultVideo is an inline query response video. type InlineQueryResultVideo struct { - InlineQueryResult + Type string `json:"type"` // required + ID string `json:"id"` // required URL string `json:"video_url"` // required MimeType string `json:"mime_type"` // required MessageText string `json:"message_text"` // required