1
0
Fork 0
telegram/inline.go

1327 lines
46 KiB
Go
Raw Normal View History

2020-01-09 15:27:00 +00:00
package telegram
type (
2020-11-05 08:28:32 +00:00
// InlineQuery represents an incoming inline query. When the user sends an empty query, your bot could return
// some default or trending results.
2020-01-09 15:27:00 +00:00
InlineQuery struct {
// Unique identifier for this query
ID string `json:"id"`
// Text of the query (up to 512 characters)
Query string `json:"query"`
// Offset of the results to be returned, can be controlled by the bot
Offset string `json:"offset"`
// Sender
From *User `json:"from"`
2021-08-01 15:15:51 +00:00
// Type of the chat, from which the inline query was sent. Can be either “sender” for a private chat
// with the inline query sender, “private”, “group”, “supergroup”, or “channel”. The chat type should
// be always known for requests sent from official clients and most third-party clients, unless the
// request was sent from a secret chat
ChatType string `json:"chat_type,omitempty"`
2020-01-09 15:27:00 +00:00
// Sender location, only for bots that request user location
Location *Location `json:"location,omitempty"`
}
// InlineQueryResult represents one result of an inline query.
InlineQueryResult interface {
IsCached() bool
}
// InlineQueryResultArticle represents a link to an article or web page.
InlineQueryResultArticle struct {
// Type of the result, must be article
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
// Title of the result
Title string `json:"title"`
// URL of the result
URL string `json:"url,omitempty"`
// Short description of the result
Description string `json:"description,omitempty"`
// Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
// Content of the message to be sent
InputMessageContent InputMessageContent `json:"input_message_content"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Pass True, if you don't want the URL to be shown in the message
HideURL bool `json:"hide_url,omitempty"`
// Thumbnail width
ThumbWidth int `json:"thumb_width,omitempty"`
// Thumbnail height
ThumbHeight int `json:"thumb_height,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultPhoto represents a link to a photo. By default, this photo will be sent by the user with
// optional caption. Alternatively, you can use input_message_content to send a message with the specified
// content instead of the photo.
2020-01-09 15:27:00 +00:00
InlineQueryResultPhoto struct {
// Type of the result, must be photo
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
2020-01-10 05:23:55 +00:00
// A valid URL of the photo. Photo must be in jpeg format. Photo size must not exceed 5MB
2020-01-09 15:27:00 +00:00
PhotoURL string `json:"photo_url"`
// URL of the thumbnail for the photo
ThumbURL string `json:"thumb_url"`
2020-11-05 08:28:32 +00:00
// Width of the photo
PhotoWidth int `json:"photo_width,omitempty"`
// Height of the photo
PhotoHeight int `json:"photo_height,omitempty"`
2020-01-09 15:27:00 +00:00
// Title for the result
Title string `json:"title,omitempty"`
// Short description of the result
Description string `json:"description,omitempty"`
// Caption of the photo to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the photo
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultGif represents a link to an animated GIF file. By default, this animated GIF file will be
// sent by the user with optional caption. Alternatively, you can use input_message_content to send a message
// with the specified content instead of the animation.
2020-01-09 15:27:00 +00:00
InlineQueryResultGif struct {
// Type of the result, must be gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the GIF file. File size must not exceed 1MB
GifURL string `json:"gif_url"`
2020-11-05 08:28:32 +00:00
// Width of the GIF
GifWidth int `json:"gif_width,omitempty"`
// Height of the GIF
GifHeight int `json:"gif_height,omitempty"`
// Duration of the GIF
GifDuration int `json:"gif_duration,omitempty"`
2020-01-09 15:27:00 +00:00
// URL of the static thumbnail for the result (jpeg or gif)
ThumbURL string `json:"thumb_url"`
2020-06-05 11:10:51 +00:00
// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to
// “image/jpeg”
ThumbMimeType string `json:"thumb_mime_type,omitempty"`
2020-01-09 15:27:00 +00:00
// Title for the result
Title string `json:"title,omitempty"`
// Caption of the GIF file to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the GIF animation
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultMpeg4Gif represents a link to a video animation (H.264/MPEG-4 AVC video without sound). By
// default, this animated MPEG-4 file will be sent by the user with optional caption. Alternatively, you can
// use input_message_content to send a message with the specified content instead of the animation.
2020-01-09 15:27:00 +00:00
InlineQueryResultMpeg4Gif struct {
// Type of the result, must be mpeg4_gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the MP4 file. File size must not exceed 1MB
Mpeg4URL string `json:"mpeg4_url"`
2020-11-05 08:28:32 +00:00
// Video width
Mpeg4Width int `json:"mpeg4_width,omitempty"`
// Video height
Mpeg4Height int `json:"mpeg4_height,omitempty"`
// Video duration
Mpeg4Duration int `json:"mpeg4_duration,omitempty"`
2020-01-09 15:27:00 +00:00
// URL of the static thumbnail (jpeg or gif) for the result
ThumbURL string `json:"thumb_url"`
2020-06-05 11:10:51 +00:00
// MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to
// “image/jpeg”
ThumbMimeType string `json:"thumb_mime_type,omitempty"`
2020-01-09 15:27:00 +00:00
// Title for the result
Title string `json:"title,omitempty"`
// Caption of the MPEG-4 file to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-06-05 11:10:51 +00:00
// Mode for parsing entities in the caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the video animation
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultVideo represents a link to a page containing an embedded video player or a video file.
// By default, this video file will be sent by the user with an optional caption. Alternatively, you can use
// input_message_content to send a message with the specified content instead of the video.
2020-01-09 15:27:00 +00:00
//
2020-11-05 08:28:32 +00:00
// If an InlineQueryResultVideo message contains an embedded video (e.g., YouTube), you must replace its
// content using input_message_content.
2020-01-09 15:27:00 +00:00
InlineQueryResultVideo struct {
// Type of the result, must be video
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the embedded video player or video file
VideoURL string `json:"video_url"`
// Mime type of the content of video url, "text/html" or "video/mp4"
MimeType string `json:"mime_type"`
// URL of the thumbnail (jpeg only) for the video
ThumbURL string `json:"thumb_url"`
// Title for the result
Title string `json:"title"`
// Caption of the video to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Video width
VideoWidth int `json:"video_width,omitempty"`
// Video height
VideoHeight int `json:"video_height,omitempty"`
// Video duration in seconds
VideoDuration int `json:"video_duration,omitempty"`
2020-11-05 08:28:32 +00:00
// Short description of the result
Description string `json:"description,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
2020-11-05 08:28:32 +00:00
// Content of the message to be sent instead of the video. This field is required if
// InlineQueryResultVideo is used to send an HTML-page as a result (e.g., a YouTube video).
2020-01-09 15:27:00 +00:00
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultAudio represents a link to an mp3 audio file. By default, this audio file will be sent by
// the user. Alternatively, you can use input_message_content to send a message with the specified content
// instead of the audio.
2020-01-09 15:27:00 +00:00
InlineQueryResultAudio struct {
// Type of the result, must be audio
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the audio file
AudioURL string `json:"audio_url"`
// Title
Title string `json:"title"`
// Caption, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Performer
Performer string `json:"performer,omitempty"`
// Audio duration in seconds
AudioDuration int `json:"audio_duration,omitempty"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the audio
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultVoice represents a link to a voice recording in an .ogg container encoded with OPUS.
// By default, this voice recording will be sent by the user. Alternatively, you can use input_message_content
// to send a message with the specified content instead of the the voice message.
2020-01-09 15:27:00 +00:00
InlineQueryResultVoice struct {
// Type of the result, must be voice
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid URL for the voice recording
VoiceURL string `json:"voice_url"`
// Recording title
Title string `json:"title"`
// Caption, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Recording duration in seconds
VoiceDuration int `json:"voice_duration,omitempty"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the voice recording
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultDocument represents a link to a file. By default, this file will be sent by the user with
// an optional caption. Alternatively, you can use input_message_content to send a message with the specified
// content instead of the file. Currently, only .PDF and .ZIP files can be sent using this method.
2020-01-09 15:27:00 +00:00
InlineQueryResultDocument struct {
// Type of the result, must be document
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// Title for the result
Title string `json:"title"`
// Caption of the document to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// A valid URL for the file
DocumentURL string `json:"document_url"`
2020-01-10 05:23:55 +00:00
// Mime type of the content of the file, either "application/pdf" or "application/zip"
2020-01-09 15:27:00 +00:00
MimeType string `json:"mime_type"`
// Short description of the result
Description string `json:"description,omitempty"`
// URL of the thumbnail (jpeg only) for the file
ThumbURL string `json:"thumb_url,omitempty"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the file
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
// Thumbnail width
ThumbWidth int `json:"thumb_width,omitempty"`
// Thumbnail height
ThumbHeight int `json:"thumb_height,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultLocation represents a location on a map. By default, the location will be sent by the
// user. Alternatively, you can use input_message_content to send a message with the specified content instead
// of the location.
2020-01-09 15:27:00 +00:00
InlineQueryResultLocation struct {
// Type of the result, must be location
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
// Location latitude in degrees
Latitude float64 `json:"latitude"`
2020-01-09 15:27:00 +00:00
// Location longitude in degrees
Longitude float64 `json:"longitude"`
2020-01-09 15:27:00 +00:00
2020-11-05 08:28:32 +00:00
// Location title
Title string `json:"title"`
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
2020-11-05 08:28:32 +00:00
// Period in seconds for which the location can be updated, should be between 60 and 86400.
LivePeriod int `json:"live_period,omitempty"`
// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360
// if specified.
Heading int `json:"heading,omitempty"`
// For live locations, a maximum distance for proximity alerts about approaching another chat member,
// in meters. Must be between 1 and 100000 if specified.
ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the location
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
2020-11-05 08:28:32 +00:00
// Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
2020-01-09 15:27:00 +00:00
// Thumbnail width
ThumbWidth int `json:"thumb_width,omitempty"`
// Thumbnail height
ThumbHeight int `json:"thumb_height,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultVenue represents a venue. By default, the venue will be sent by the user. Alternatively,
// you can use input_message_content to send a message with the specified content instead of the venue.
2020-01-09 15:27:00 +00:00
InlineQueryResultVenue struct {
// Type of the result, must be venue
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
2020-11-05 08:28:32 +00:00
// Latitude of the venue location in degrees
Latitude float64 `json:"latitude"`
2020-11-05 08:28:32 +00:00
// Longitude of the venue location in degrees
Longitude float64 `json:"longitude"`
2020-11-05 08:28:32 +00:00
2020-01-09 15:27:00 +00:00
// Title of the venue
Title string `json:"title"`
// Address of the venue
Address string `json:"address"`
// Foursquare identifier of the venue if known
FoursquareID string `json:"foursquare_id,omitempty"`
2020-11-05 08:28:32 +00:00
// Foursquare type of the venue, if known. (For example, "arts_entertainment/default",
// "arts_entertainment/aquarium" or "food/icecream".)
2020-01-09 15:27:00 +00:00
FoursquareType string `json:"foursquare_type,omitempty"`
2020-11-05 08:28:32 +00:00
// Google Places identifier of the venue
GooglePlaceID string `json:"google_place_id,omitempty"`
2020-01-09 15:27:00 +00:00
2020-11-05 08:28:32 +00:00
// Google Places type of the venue.
GooglePlaceType string `json:"google_place_type,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the venue
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
2020-11-05 08:28:32 +00:00
// Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
2020-01-09 15:27:00 +00:00
// Thumbnail width
ThumbWidth int `json:"thumb_width,omitempty"`
// Thumbnail height
ThumbHeight int `json:"thumb_height,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultContact represents a contact with a phone number. By default, this contact will be sent by
// the user. Alternatively, you can use input_message_content to send a message with the specified content
// instead of the contact.
2020-01-09 15:27:00 +00:00
InlineQueryResultContact struct {
// Type of the result, must be contact
Type string `json:"type"`
// Unique identifier for this result, 1-64 Bytes
ID string `json:"id"`
// Contact's phone number
PhoneNumber string `json:"phone_number"`
// Contact's first name
FirstName string `json:"first_name"`
// Contact's last name
LastName string `json:"last_name,omitempty"`
// Additional data about the contact in the form of a vCard, 0-2048 bytes
VCard string `json:"vcard,omitempty"`
// Url of the thumbnail for the result
ThumbURL string `json:"thumb_url,omitempty"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the contact
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
// Thumbnail width
ThumbWidth int `json:"thumb_width,omitempty"`
// Thumbnail height
ThumbHeight int `json:"thumb_height,omitempty"`
}
// InlineQueryResultGame represents a Game.
InlineQueryResultGame struct {
// Type of the result, must be game
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// Short name of the game
GameShortName string `json:"game_short_name"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedPhoto represents a link to a photo stored on the Telegram servers. By default, this
// photo will be sent by the user with an optional caption. Alternatively, you can use input_message_content
// to send a message with the specified content instead of the photo.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedPhoto struct {
// Type of the result, must be photo
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier of the photo
PhotoFileID string `json:"photo_file_id"`
// Title for the result
Title string `json:"title,omitempty"`
// Short description of the result
Description string `json:"description,omitempty"`
// Caption of the photo to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the photo
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedGif represents a link to an animated GIF file stored on the Telegram servers.
// By default, this animated GIF file will be sent by the user with an optional caption. Alternatively, you
// can use input_message_content to send a message with specified content instead of the animation.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedGif struct {
// Type of the result, must be gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the GIF file
GifFileID string `json:"gif_file_id"`
// Title for the result
Title string `json:"title,omitempty"`
// Caption of the GIF file to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the GIF animation
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedMpeg4Gif represents a link to a video animation (H.264/MPEG-4 AVC video without
// sound) stored on the Telegram servers. By default, this animated MPEG-4 file will be sent by the user with
// an optional caption. Alternatively, you can use input_message_content to send a message with the specified
// content instead of the animation.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedMpeg4Gif struct {
// Type of the result, must be mpeg4_gif
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the MP4 file
Mpeg4FileID string `json:"mpeg4_file_id"`
// Title for the result
Title string `json:"title,omitempty"`
// Caption of the MPEG-4 file to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the video animation
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedSticker represents a link to a sticker stored on the Telegram servers. By default,
// this sticker will be sent by the user. Alternatively, you can use input_message_content to send a message
// with the specified content instead of the sticker.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedSticker struct {
// Type of the result, must be sticker
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier of the sticker
StickerFileID string `json:"sticker_file_id"`
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the sticker
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedDocument represents a link to a file stored on the Telegram servers. By default,
// this file will be sent by the user with an optional caption. Alternatively, you can use
// input_message_content to send a message with the specified content instead of the file.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedDocument struct {
// Type of the result, must be document
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// Title for the result
Title string `json:"title"`
// A valid file identifier for the file
DocumentFileID string `json:"document_file_id"`
// Short description of the result
Description string `json:"description,omitempty"`
// Caption of the document to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the file
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedVideo represents a link to a video file stored on the Telegram servers. By default,
// this video file will be sent by the user with an optional caption. Alternatively, you can use
// input_message_content to send a message with the specified content instead of the video.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedVideo struct {
// Type of the result, must be video
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the video file
VideoFileID string `json:"video_file_id"`
// Title for the result
Title string `json:"title"`
// Short description of the result
Description string `json:"description,omitempty"`
// Caption of the video to be sent, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the video
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedVoice represents a link to a voice message stored on the Telegram servers. By
// default, this voice message will be sent by the user. Alternatively, you can use input_message_content to
// send a message with the specified content instead of the voice message.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedVoice struct {
// Type of the result, must be voice
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the voice message
VoiceFileID string `json:"voice_file_id"`
// Voice message title
Title string `json:"title"`
// Caption, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the voice message
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InlineQueryResultCachedAudio represents a link to an mp3 audio file stored on the Telegram servers. By
// default, this audio file will be sent by the user. Alternatively, you can use input_message_content to send
// a message with the specified content instead of the audio.
2020-01-09 15:27:00 +00:00
InlineQueryResultCachedAudio struct {
// Type of the result, must be audio
Type string `json:"type"`
// Unique identifier for this result, 1-64 bytes
ID string `json:"id"`
// A valid file identifier for the audio file
AudioFileID string `json:"audio_file_id"`
// Caption, 0-200 characters
Caption string `json:"caption,omitempty"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in the media caption.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Inline keyboard attached to the message
ReplyMarkup *InlineKeyboardMarkup `json:"reply_markup,omitempty"`
// Content of the message to be sent instead of the audio
InputMessageContent InputMessageContent `json:"input_message_content,omitempty"`
}
// InputMessageContent represents the content of a message to be sent as a result of an inline query.
InputMessageContent interface {
isInputMessageContent()
}
2020-11-05 08:28:32 +00:00
// InputTextMessageContent represents the content of a text message to be sent as the result of an inline
// query.
2020-01-09 15:27:00 +00:00
InputTextMessageContent struct {
// Text of the message to be sent, 1-4096 characters
MessageText string `json:"message_text"`
2020-11-05 08:28:32 +00:00
// Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline
// URLs in your bot's message.
2020-01-09 15:27:00 +00:00
ParseMode string `json:"parse_mode,omitempty"`
2020-11-05 08:28:32 +00:00
// List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []*MessageEntity `json:"caption_entities,omitempty"`
2020-01-09 15:27:00 +00:00
// Disables link previews for links in the sent message
DisableWebPagePreview bool `json:"disable_web_page_preview,omitempty"`
}
2020-11-05 08:28:32 +00:00
// InputLocationMessageContent represents the content of a location message to be sent as the result of an
// inline query.
2020-01-09 15:27:00 +00:00
InputLocationMessageContent struct {
// Latitude of the location in degrees
Latitude float64 `json:"latitude"`
2020-01-09 15:27:00 +00:00
// Longitude of the location in degrees
Longitude float64 `json:"longitude"`
2020-01-09 15:27:00 +00:00
2020-11-05 08:28:32 +00:00
// The radius of uncertainty for the location, measured in meters; 0-1500
HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"`
2020-11-05 08:28:32 +00:00
2020-01-09 15:27:00 +00:00
// Period in seconds for which the location can be updated, should be between 60 and 86400.
LivePeriod int `json:"live_period,omitempty"`
2020-11-05 08:28:32 +00:00
// For live locations, a direction in which the user is moving, in degrees. Must be between 1 and 360
// if specified.
Heading int `json:"heading,omitempty"`
// For live locations, a maximum distance for proximity alerts about approaching another chat member,
// in meters. Must be between 1 and 100000 if specified.
ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"`
2020-01-09 15:27:00 +00:00
}
2020-11-05 08:28:32 +00:00
// InputVenueMessageContent represents the content of a venue message to be sent as the result of an inline
// query.
2020-01-09 15:27:00 +00:00
InputVenueMessageContent struct {
// Latitude of the location in degrees
Latitude float64 `json:"latitude"`
2020-01-09 15:27:00 +00:00
// Longitude of the location in degrees
Longitude float64 `json:"longitude"`
2020-01-09 15:27:00 +00:00
// Name of the venue
Title string `json:"title"`
// Address of the venue
Address string `json:"address"`
// Foursquare identifier of the venue, if known
FoursquareID string `json:"foursquare_id,omitempty"`
2020-11-05 08:28:32 +00:00
// Foursquare type of the venue, if known. (For example, "arts_entertainment/default",
// "arts_entertainment/aquarium" or "food/icecream".)
2020-01-09 15:27:00 +00:00
FoursquareType string `json:"foursquare_type,omitempty"`
2020-11-05 08:28:32 +00:00
// Google Places identifier of the venue
GooglePlaceId string `json:"google_place_id,omitempty"`
// Google Places type of the venue.
GooglePlaceType string `json:"google_place_type,omitempty"`
2020-01-09 15:27:00 +00:00
}
2020-11-05 08:28:32 +00:00
// InputContactMessageContent represents the content of a contact message to be sent as the result of an
// inline query.
2020-01-09 15:27:00 +00:00
InputContactMessageContent struct {
// Contact's phone number
PhoneNumber string `json:"phone_number"`
// Contact's first name
FirstName string `json:"first_name"`
// Contact's last name
LastName string `json:"last_name,omitempty"`
// Additional data about the contact in the form of a vCard, 0-2048 bytes
VCard string `json:"vcard,omitempty"`
}
2021-08-01 15:15:51 +00:00
// InputInvoiceMessageContent represents the content of an invoice message to be sent as the result of an inline query.
InputInvoiceMessageContent struct {
// Product name, 1-32 characters
Title string `json:"title"`
// Product description, 1-255 characters
Description string `json:"description"`
// Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your
// internal processes.
Payload string `json:"payload"`
// Payment provider token, obtained via Botfather
ProviderToken string `json:"provider_token"`
// Three-letter ISO 4217 currency code
Currency string `json:"currency"`
// Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery
// cost, delivery tax, bonus, etc.)
Prices []*LabeledPrice `json:"prices,omitempty"`
// The maximum accepted amount for tips in the smallest units of the currency (integer, not
// float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp
// parameter in currencies.json, it shows the number of digits past the decimal point for each currency
// (2 for the majority of currencies). Defaults to 0
MaxTipAmount int `json:"max_tip_amount,omitempty"`
// A JSON-serialized array of suggested amounts of tip in the smallest units of the currency (integer,
// not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must
// be positive, passed in a strictly increased order and must not exceed max_tip_amount.
SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"`
// A JSON-serialized object for data about the invoice, which will be shared with the payment provider.
// A detailed description of the required fields should be provided by the payment provider.
ProviderData string `json:"provider_data,omitempty"`
// URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a
// service. People like it better when they see what they are paying for.
PhotoURL string `json:"photo_url,omitempty"`
// Photo size
PhotoSize int `json:"photo_size,omitempty"`
// Photo width
PhotoWidth int `json:"photo_width,omitempty"`
// Photo height
PhotoHeight int `json:"photo_height,omitempty"`
// Pass True, if you require the user's full name to complete the order
NeedName bool `json:"need_name,omitempty"`
// Pass True, if you require the user's phone number to complete the order
NeedPhoneNumber bool `json:"need_phone_number,omitempty"`
// Pass True, if you require the user's email address to complete the order
NeedEmail bool `json:"need_email,omitempty"`
// Pass True, if you require the user's shipping address to complete the order
NeedShippingAddress bool `json:"need_shipping_address,omitempty"`
// Pass True, if user's phone number should be sent to provider
SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"`
// Pass True, if user's email address should be sent to provider
SendEmailToProvider bool `json:"send_email_to_provider,omitempty"`
// Pass True, if the final price depends on the shipping method
IsFlexible bool `json:"is_flexible,omitempty"`
}
2020-11-05 08:28:32 +00:00
// ChosenInlineResult represents a result of an inline query that was chosen by the user and sent to their
// chat partner.
2020-01-09 15:27:00 +00:00
ChosenInlineResult struct {
// The unique identifier for the result that was chosen
ResultID string `json:"result_id"`
2020-11-05 08:28:32 +00:00
// Identifier of the sent inline message. Available only if there is an inline keyboard attached to
// the message. Will be also received in callback queries and can be used to edit the message.
2020-01-09 15:27:00 +00:00
InlineMessageID string `json:"inline_message_id,omitempty"`
// The query that was used to obtain the result
Query string `json:"query"`
// The user that chose the result
From *User `json:"from"`
// Sender location, only for bots that require user location
Location *Location `json:"location,omitempty"`
}
// AnswerInlineQueryParameters represents data for AnswerInlineQuery method.
AnswerInlineQuery struct {
// Unique identifier for the answered query
InlineQueryID string `json:"inline_query_id"`
2020-11-05 08:28:32 +00:00
// Pass the offset that a client should send in the next query with the same text to receive more
// results. Pass an empty string if there are no more results or if you dont support pagination.
// Offset length cant exceed 64 bytes.
2020-01-09 15:27:00 +00:00
NextOffset string `json:"next_offset,omitempty"`
2020-11-05 08:28:32 +00:00
// If passed, clients will display a button with specified text that switches the user to a private
// chat with the bot and sends the bot a start message with the parameter switch_pm_parameter
2020-01-09 15:27:00 +00:00
SwitchPrivateMessageText string `json:"switch_pm_text,omitempty"`
2020-11-05 08:28:32 +00:00
// Deep-linking parameter for the /start message sent to the bot when user presses the switch button.
// 1-64 characters, only A-Z, a-z, 0-9, _ and - are allowed.
2020-01-09 15:27:00 +00:00
SwitchPrivateMessageParameter string `json:"switch_pm_parameter,omitempty"`
// A JSON-serialized array of results for the inline query
Results []InlineQueryResult `json:"results"`
2020-11-05 08:28:32 +00:00
// The maximum amount of time in seconds that the result of the inline query may be cached on the
// server. Defaults to 300.
2020-01-09 15:27:00 +00:00
CacheTime int `json:"cache_time,omitempty"`
2020-11-05 08:28:32 +00:00
// Pass True, if results may be cached on the server side only for the user that sent the query. By
// default, results may be returned to any user who sends the same query
2020-01-09 15:27:00 +00:00
IsPersonal bool `json:"is_personal,omitempty"`
}
ReplyMarkup interface {
isReplyMarkup()
}
)
2020-01-28 08:30:47 +00:00
func NewAnswerInline(inlineQueryID string, results ...InlineQueryResult) AnswerInlineQuery {
return AnswerInlineQuery{
InlineQueryID: inlineQueryID,
Results: results,
}
}
2020-01-09 15:27:00 +00:00
// AnswerInlineQuery send answers to an inline query. On success, True is returned.
//
// No more than 50 results per query are allowed.
func (b Bot) AnswerInlineQuery(p AnswerInlineQuery) (ok bool, err error) {
2020-01-09 15:27:00 +00:00
src, err := b.Do(MethodAnswerInlineQuery, p)
if err != nil {
return ok, err
2020-01-09 15:27:00 +00:00
}
if err = parseResponseError(b.marshler, src, &ok); err != nil {
return
2020-01-09 15:27:00 +00:00
}
return
2020-01-09 15:27:00 +00:00
}
2020-01-28 08:30:47 +00:00
func NewReplyKeyboardRemove(selective bool) ReplyKeyboardRemove {
return ReplyKeyboardRemove{
RemoveKeyboard: true,
Selective: selective,
}
}
func NewInlineKeyboardButton(text, data string) *InlineKeyboardButton {
return &InlineKeyboardButton{
Text: text,
CallbackData: data,
}
}
func NewInlineKeyboardButtonSwitch(text, sw string) *InlineKeyboardButton {
return &InlineKeyboardButton{
Text: text,
SwitchInlineQuery: sw,
}
}
func NewInlineKeyboardButtonSwitchSelf(text, sw string) *InlineKeyboardButton {
return &InlineKeyboardButton{
Text: text,
SwitchInlineQueryCurrentChat: sw,
}
}
func NewInlineKeyboardButtonURL(text, url string) *InlineKeyboardButton {
return &InlineKeyboardButton{
Text: text,
URL: url,
}
}
func NewInlineKeyboardMarkup(rows ...[]*InlineKeyboardButton) InlineKeyboardMarkup {
return InlineKeyboardMarkup{InlineKeyboard: rows}
}
func NewInlineKeyboardRow(buttons ...*InlineKeyboardButton) []*InlineKeyboardButton {
return buttons
}
2020-01-09 15:27:00 +00:00
func (iq InlineQuery) HasQuery() bool { return iq.Query != "" }
func (iq InlineQuery) HasOffset() bool { return iq.Offset != "" }
func (iq InlineQuery) HasLocation() bool { return iq.Location != nil }
func (cir ChosenInlineResult) HasLocation() bool { return cir.Location != nil }
func (InputTextMessageContent) isInputMessageContent() {}
func (InputLocationMessageContent) isInputMessageContent() {}
func (InputVenueMessageContent) isInputMessageContent() {}
func (InputContactMessageContent) isInputMessageContent() {}
func NewInlineQueryResultCachedAudio(id, file string) InlineQueryResultCachedAudio {
return InlineQueryResultCachedAudio{
Type: TypeAudio,
ID: id,
AudioFileID: file,
}
}
func (InlineQueryResultCachedAudio) IsCached() bool { return true }
func NewInlineQueryResultCachedDocument(id, title, file string) InlineQueryResultCachedDocument {
return InlineQueryResultCachedDocument{
Type: TypeDocument,
ID: id,
Title: title,
DocumentFileID: file,
}
}
func (InlineQueryResultCachedDocument) IsCached() bool { return true }
func NewInlineQueryResultCachedGif(id, file string) InlineQueryResultCachedGif {
return InlineQueryResultCachedGif{
Type: TypeGIF,
ID: id,
GifFileID: file,
}
}
func (InlineQueryResultCachedGif) IsCached() bool { return true }
func NewInlineQueryResultCachedMpeg4Gif(id, file string) InlineQueryResultCachedMpeg4Gif {
return InlineQueryResultCachedMpeg4Gif{
Type: TypeMpeg4Gif,
ID: id,
Mpeg4FileID: file,
}
}
func (InlineQueryResultCachedMpeg4Gif) IsCached() bool { return true }
func NewInlineQueryResultCachedPhoto(id, file string) InlineQueryResultCachedPhoto {
return InlineQueryResultCachedPhoto{
Type: TypePhoto,
ID: id,
PhotoFileID: file,
}
}
func (InlineQueryResultCachedPhoto) IsCached() bool { return true }
func NewInlineQueryResultCachedSticker(id, file string) InlineQueryResultCachedSticker {
return InlineQueryResultCachedSticker{
Type: TypeSticker,
ID: id,
StickerFileID: file,
}
}
func (InlineQueryResultCachedSticker) IsCached() bool { return true }
func NewInlineQueryResultCachedVideo(id, title, file string) InlineQueryResultCachedVideo {
return InlineQueryResultCachedVideo{
Type: TypeVideo,
ID: id,
Title: title,
VideoFileID: file,
}
}
func (InlineQueryResultCachedVideo) IsCached() bool { return true }
func NewInlineQueryResultCachedVoice(id, title, file string) InlineQueryResultCachedVoice {
return InlineQueryResultCachedVoice{
Type: TypeVoice,
ID: id,
Title: title,
VoiceFileID: file,
}
}
func (InlineQueryResultCachedVoice) IsCached() bool { return true }
func NewInlineQueryResultArticle(id, title string, content InputMessageContent) InlineQueryResultArticle {
return InlineQueryResultArticle{
Type: TypeArticle,
ID: id,
Title: title,
InputMessageContent: content,
}
}
func (InlineQueryResultArticle) IsCached() bool { return false }
func NewInlineQueryResultAudio(id, title, audio string) InlineQueryResultAudio {
return InlineQueryResultAudio{
Type: TypeAudio,
ID: id,
Title: title,
AudioURL: audio,
}
}
func (InlineQueryResultAudio) IsCached() bool { return false }
func NewInlineQueryResultContact(id, phone, name string) InlineQueryResultContact {
return InlineQueryResultContact{
Type: TypeContact,
ID: id,
PhoneNumber: phone,
FirstName: name,
}
}
func (InlineQueryResultContact) IsCached() bool { return false }
func NewInlineQueryResultGame(id, shortName string) InlineQueryResultGame {
return InlineQueryResultGame{
Type: TypeGame,
ID: id,
GameShortName: shortName,
}
}
func (InlineQueryResultGame) IsCached() bool { return false }
func NewInlineQueryResultDocument(id, title, mime, document string) InlineQueryResultDocument {
return InlineQueryResultDocument{
Type: TypeDocument,
ID: id,
Title: title,
MimeType: mime,
DocumentURL: document,
}
}
func (InlineQueryResultDocument) IsCached() bool { return false }
func NewInlineQueryResultGif(id, gif, thumb string) InlineQueryResultGif {
return InlineQueryResultGif{
Type: TypeGIF,
ID: id,
GifURL: gif,
ThumbURL: thumb,
}
}
func (InlineQueryResultGif) IsCached() bool { return false }
func NewInlineQueryResultLocation(id, title string, lat, long float64) InlineQueryResultLocation {
2020-01-09 15:27:00 +00:00
return InlineQueryResultLocation{
Type: TypeLocation,
ID: id,
Title: title,
Latitude: lat,
Longitude: long,
}
}
func (InlineQueryResultLocation) IsCached() bool { return false }
func NewInlineQueryResultMpeg4Gif(id, mpeg4, thumb string) InlineQueryResultMpeg4Gif {
return InlineQueryResultMpeg4Gif{
Type: TypeMpeg4Gif,
ID: id,
Mpeg4URL: mpeg4,
ThumbURL: thumb,
}
}
func (InlineQueryResultMpeg4Gif) IsCached() bool { return false }
func NewInlineQueryResultPhoto(id, photo, thumb string) InlineQueryResultPhoto {
return InlineQueryResultPhoto{
Type: TypePhoto,
ID: id,
PhotoURL: photo,
ThumbURL: thumb,
}
}
func (InlineQueryResultPhoto) IsCached() bool { return false }
func NewInlineQueryResultVenue(id, title, addr string, lat, long float64) InlineQueryResultVenue {
2020-01-09 15:27:00 +00:00
return InlineQueryResultVenue{
Type: TypeVenue,
ID: id,
Title: title,
Address: addr,
Latitude: lat,
Longitude: long,
}
}
func (InlineQueryResultVenue) IsCached() bool { return false }
func NewInlineQueryResultVideo(id, title, mime, video, thumb string) InlineQueryResultVideo {
return InlineQueryResultVideo{
Type: TypeVideo,
ID: id,
VideoURL: video,
MimeType: mime,
Title: title,
ThumbURL: thumb,
}
}
func (InlineQueryResultVideo) IsCached() bool { return false }
func NewInlineQueryResultVoice(id, title, voice string) InlineQueryResultVoice {
return InlineQueryResultVoice{
Type: TypeVoice,
ID: id,
Title: title,
VoiceURL: voice,
}
}
func (InlineQueryResultVoice) IsCached() bool { return false }
func (InlineKeyboardMarkup) isReplyMarkup() {}
func (ReplyKeyboardMarkup) isReplyMarkup() {}
func (ReplyKeyboardRemove) isReplyMarkup() {}
func (ForceReply) isReplyMarkup() {}