Add inline query result cached photo and gif types documentation

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

102
types.go
View File

@ -849,30 +849,92 @@ type InlineQueryResultPhoto struct {
// InlineQueryResultCachedPhoto is an inline query response with cached photo. // InlineQueryResultCachedPhoto is an inline query response with cached photo.
type InlineQueryResultCachedPhoto struct { type InlineQueryResultCachedPhoto struct {
Type string `json:"type"` // required // Type of the result, must be photo.
ID string `json:"id"` // required //
PhotoID string `json:"photo_file_id"` // required // required
Title string `json:"title"` Type string `json:"type"`
Description string `json:"description"` // ID unique identifier for this result, 1-64 bytes.
Caption string `json:"caption"` //
ParseMode string `json:"parse_mode"` // required
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` ID string `json:"id"`
InputMessageContent interface{} `json:"input_message_content,omitempty"` // PhotoID a valid file identifier of the photo.
//
// required
PhotoID string `json:"photo_file_id"`
// 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"`
} }
// InlineQueryResultGIF is an inline query response GIF. // InlineQueryResultGIF is an inline query response GIF.
type InlineQueryResultGIF struct { type InlineQueryResultGIF struct {
Type string `json:"type"` // required // Type of the result, must be gif.
ID string `json:"id"` // required //
URL string `json:"gif_url"` // required // required
ThumbURL string `json:"thumb_url"` // required Type string `json:"type"`
Width int `json:"gif_width,omitempty"` // ID unique identifier for this result, 1-64 bytes.
Height int `json:"gif_height,omitempty"` //
Duration int `json:"gif_duration,omitempty"` // required
Title string `json:"title,omitempty"` ID string `json:"id"`
Caption string `json:"caption,omitempty"` // URL a valid URL for the GIF file. File size must not exceed 1MB.
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"` //
InputMessageContent interface{} `json:"input_message_content,omitempty"` // required
URL string `json:"gif_url"`
// ThumbURL url of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result.
//
// required
ThumbURL string `json:"thumb_url"`
// Width of the GIF
//
// optional
Width int `json:"gif_width,omitempty"`
// Height of the GIF
//
// optional
Height int `json:"gif_height,omitempty"`
// Duration of the GIF
//
// optional
Duration int `json:"gif_duration,omitempty"`
// Title for the result
//
// optional
Title string `json:"title,omitempty"`
// Caption of the GIF file to be sent, 0-1024 characters after entities parsing.
//
// optional
Caption string `json:"caption,omitempty"`
// 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 GIF animation.
//
// optional
InputMessageContent interface{} `json:"input_message_content,omitempty"`
} }
// InlineQueryResultCachedGIF is an inline query response with cached gif. // InlineQueryResultCachedGIF is an inline query response with cached gif.