Add inline query types documentation

bot-api-6.1
Ilya Kaznacheev 2020-10-24 17:44:17 +03:00
parent b6df6c273a
commit 12b37b42cc
No known key found for this signature in database
GPG Key ID: 7E2C1D8A4AB37D50
1 changed files with 107 additions and 29 deletions

136
types.go
View File

@ -730,43 +730,121 @@ type InputMediaVideo struct {
// InlineQuery is a Query from Telegram for an inline request. // InlineQuery is a Query from Telegram for an inline request.
type InlineQuery struct { type InlineQuery struct {
ID string `json:"id"` // ID unique identifier for this query
From *User `json:"from"` ID string `json:"id"`
Location *Location `json:"location"` // optional // From sender
Query string `json:"query"` From *User `json:"from"`
Offset string `json:"offset"` // Location sender location, only for bots that request user location.
//
// optional
Location *Location `json:"location"`
// Query text of the query (up to 256 characters).
Query string `json:"query"`
// Offset of the results to be returned, can be controlled by the bot.
Offset string `json:"offset"`
} }
// InlineQueryResultArticle is an inline query response article. // InlineQueryResultArticle is an inline query response article.
type InlineQueryResultArticle struct { type InlineQueryResultArticle struct {
Type string `json:"type"` // required // Type of the result, must be article.
ID string `json:"id"` // required //
Title string `json:"title"` // required // required
InputMessageContent interface{} `json:"input_message_content,omitempty"` // required Type string `json:"type"`
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // ID unique identifier for this result, 1-64 Bytes.
URL string `json:"url"` //
HideURL bool `json:"hide_url"` // required
Description string `json:"description"` ID string `json:"id"`
ThumbURL string `json:"thumb_url"` // Title of the result
ThumbWidth int `json:"thumb_width"` //
ThumbHeight int `json:"thumb_height"` // required
Title string `json:"title"`
// InputMessageContent content of the message to be sent.
//
// required
InputMessageContent interface{} `json:"input_message_content,omitempty"`
// ReplyMarkup Inline keyboard attached to the message.
//
// optional
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// URL of the result.
//
// optional
URL string `json:"url"`
// HideURL pass True, if you don't want the URL to be shown in the message.
//
// optional
HideURL bool `json:"hide_url"`
// Description short description of the result.
//
// optional
Description string `json:"description"`
// ThumbURL url of the thumbnail for the result
//
// optional
ThumbURL string `json:"thumb_url"`
// ThumbWidth thumbnail width
//
// optional
ThumbWidth int `json:"thumb_width"`
// ThumbHeight thumbnail height
//
// optional
ThumbHeight int `json:"thumb_height"`
} }
// InlineQueryResultPhoto is an inline query response photo. // InlineQueryResultPhoto is an inline query response photo.
type InlineQueryResultPhoto struct { type InlineQueryResultPhoto struct {
Type string `json:"type"` // required // Type of the result, must be article.
ID string `json:"id"` // required //
URL string `json:"photo_url"` // required // required
MimeType string `json:"mime_type"` Type string `json:"type"`
Width int `json:"photo_width"` // ID unique identifier for this result, 1-64 Bytes.
Height int `json:"photo_height"` //
ThumbURL string `json:"thumb_url"` // required
Title string `json:"title"` ID string `json:"id"`
Description string `json:"description"` // URL a valid URL of the photo. Photo must be in jpeg format.
Caption string `json:"caption"` // Photo size must not exceed 5MB.
ParseMode string `json:"parse_mode"` URL string `json:"photo_url"`
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` // MimeType
InputMessageContent interface{} `json:"input_message_content,omitempty"` MimeType string `json:"mime_type"`
// Width of the photo
//
// optional
Width int `json:"photo_width"`
// Height of the photo
//
// optional
Height int `json:"photo_height"`
// ThumbURL url of the thumbnail for the photo.
//
// optional
ThumbURL string `json:"thumb_url"`
// Title for the result
//
// optional
Title string `json:"title"`
// Description short description of the result
//
// optional
Description string `json:"description"`
// Caption of the photo to be sent, 0-1024 characters after entities parsing.
//
// optional
Caption string `json:"caption"`
// ParseMode mode for parsing entities in the photo caption.
// See formatting options for more details
// (https://core.telegram.org/bots/api#formatting-options).
//
// optional
ParseMode string `json:"parse_mode"`
// ReplyMarkup inline keyboard attached to the message.
//
// optional
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// InputMessageContent content of the message to be sent instead of the photo.
//
// optional
InputMessageContent interface{} `json:"input_message_content,omitempty"`
} }
// InlineQueryResultCachedPhoto is an inline query response with cached photo. // InlineQueryResultCachedPhoto is an inline query response with cached photo.