+468
-177
@@ -3,107 +3,183 @@ package tgapi
|
||||
// Animation represents an animation file (GIF or H.264/MPEG-4 AVC without sound).
|
||||
// Since: Bot API 4.0
|
||||
type Animation struct {
|
||||
FileID string `json:"file_id"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
Duration int `json:"duration"`
|
||||
// Width Video width as defined by the sender
|
||||
Width int `json:"width"`
|
||||
// Height Video height as defined by the sender
|
||||
Height int `json:"height"`
|
||||
// Duration Duration of the video in seconds as defined by the sender
|
||||
Duration int `json:"duration"`
|
||||
|
||||
// Thumbnail Optional. Animation thumbnail as defined by the sender
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
FileName string `json:"file_name"`
|
||||
MimeType string `json:"mime_type"`
|
||||
FileSize int `json:"file_size"`
|
||||
// FileName Optional. Original animation filename as defined by the sender
|
||||
FileName string `json:"file_name"`
|
||||
// MimeType Optional. MIME type of the file as defined by the sender
|
||||
MimeType string `json:"mime_type"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int `json:"file_size"`
|
||||
}
|
||||
|
||||
// Audio represents an audio file to be treated as music by the Telegram clients.
|
||||
// Since: Bot API 1.2
|
||||
// See https://core.telegram.org/bots/api#audio
|
||||
type Audio struct {
|
||||
FileID string `json:"file_id"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Duration int `json:"duration"`
|
||||
// Duration Duration of the audio in seconds as defined by the sender
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Performer string `json:"performer,omitempty"`
|
||||
Title string `json:"title,omitempty"`
|
||||
FileName string `json:"file_name,omitempty"` // Since: Bot API 5.0
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// Performer Optional. Performer of the audio as defined by the sender or by audio tags
|
||||
Performer string `json:"performer,omitempty"`
|
||||
// Title Optional. Title of the audio as defined by the sender or by audio tags
|
||||
Title string `json:"title,omitempty"`
|
||||
// FileName Optional. Original filename as defined by the sender
|
||||
FileName string `json:"file_name,omitempty"` // Since: Bot API 5.0
|
||||
// MimeType Optional. MIME type of the file as defined by the sender
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// Thumbnail Optional. Thumbnail of the album cover to which the music file belongs
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
}
|
||||
|
||||
// Document represents a general file (as opposed to photos, voice messages and audio files).
|
||||
// Since: Bot API 1.0
|
||||
type Document struct {
|
||||
FileID string `json:"file_id"`
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
FileName string `json:"file_name"`
|
||||
MimeType string `json:"mime_type"`
|
||||
FileSize int `json:"file_size,omitempty"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
// Thumbnail Optional. Document thumbnail as defined by the sender
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// FileName Optional. Original filename as defined by the sender
|
||||
FileName string `json:"file_name"`
|
||||
// MimeType Optional. MIME type of the file as defined by the sender
|
||||
MimeType string `json:"mime_type"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
// Story represents a story.
|
||||
// Since: Bot API 6.8
|
||||
type Story struct {
|
||||
// Chat Chat that posted the story
|
||||
Chat Chat `json:"chat"`
|
||||
ID int `json:"id"`
|
||||
// ID Unique identifier for the story in the chat
|
||||
ID int `json:"id"`
|
||||
}
|
||||
|
||||
// Video represents a video file.
|
||||
// Since: Bot API 1.0
|
||||
type Video struct {
|
||||
FileID string `json:"file_id"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
Duration int `json:"duration"`
|
||||
// Width Video width as defined by the sender
|
||||
Width int `json:"width"`
|
||||
// Height Video height as defined by the sender
|
||||
Height int `json:"height"`
|
||||
// Duration Duration of the video in seconds as defined by the sender
|
||||
Duration int `json:"duration"`
|
||||
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
Cover []PhotoSize `json:"cover,omitempty"` // Since: Bot API 8.3
|
||||
StartTimestamp int64 `json:"start_timestamp"` // Since: Bot API 8.3
|
||||
Qualities []VideoQuality `json:"qualities,omitempty"` // Since: Bot API 9.4
|
||||
FileName string `json:"file_name,omitempty"`
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// Thumbnail Optional. Video thumbnail
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// Cover Optional. Available sizes of the cover of the video in the message
|
||||
Cover []PhotoSize `json:"cover,omitempty"` // Since: Bot API 8.3
|
||||
// StartTimestamp Optional. Timestamp in seconds from which the video will play in the message
|
||||
StartTimestamp int64 `json:"start_timestamp"` // Since: Bot API 8.3
|
||||
// Qualities Optional. List of available qualities of the video
|
||||
Qualities []VideoQuality `json:"qualities,omitempty"` // Since: Bot API 9.4
|
||||
// FileName Optional. Original filename as defined by the sender
|
||||
FileName string `json:"file_name,omitempty"`
|
||||
// MimeType Optional. MIME type of the file as defined by the sender
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
// VideoQuality describes an alternative quality for a video.
|
||||
// Since: Bot API 9.4
|
||||
// See https://core.telegram.org/bots/api#videoquality
|
||||
type VideoQuality struct {
|
||||
FileID string `json:"file_id"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
Codec string `json:"codec"`
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// Width Video width
|
||||
Width int `json:"width"`
|
||||
// Height Video height
|
||||
Height int `json:"height"`
|
||||
// Codec Codec that was used to encode the video, for example, “h264”, “h265”, or “av01”
|
||||
Codec string `json:"codec"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
// VideoNote represents a video message.
|
||||
// Since: Bot API 3.0
|
||||
type VideoNote struct {
|
||||
FileID string `json:"file_id"`
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Length int `json:"length"`
|
||||
Duration int `json:"duration"`
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
// Length Video width and height (diameter of the video message) as defined by the sender
|
||||
Length int `json:"length"`
|
||||
// Duration Duration of the video in seconds as defined by the sender
|
||||
Duration int `json:"duration"`
|
||||
// Thumbnail Optional. Video thumbnail
|
||||
Thumbnail *PhotoSize `json:"thumbnail,omitempty"`
|
||||
// FileSize Optional. File size in bytes
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
// Voice represents a voice note.
|
||||
// Since: Bot API 1.2
|
||||
type Voice struct {
|
||||
FileID string `json:"file_id"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Duration int `json:"duration"`
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
FileSize int `json:"file_size,omitempty"`
|
||||
// Duration Duration of the audio in seconds as defined by the sender
|
||||
Duration int `json:"duration"`
|
||||
// MimeType Optional. MIME type of the file as defined by the sender
|
||||
MimeType string `json:"mime_type,omitempty"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
// PaidMediaInfo describes paid media.
|
||||
// Since: Bot API 7.6
|
||||
type PaidMediaInfo struct {
|
||||
StarCount int `json:"star_count"`
|
||||
// StarCount The number of Telegram Stars that must be paid to buy access to the media
|
||||
StarCount int `json:"star_count"`
|
||||
// PaidMedia Information about the paid media
|
||||
PaidMedia []PaidMedia `json:"paid_media"`
|
||||
}
|
||||
|
||||
@@ -125,48 +201,78 @@ const (
|
||||
// PaidMedia describes paid media content.
|
||||
// Since: Bot API 7.6
|
||||
type PaidMedia struct {
|
||||
// Type identifies the preview, photo, video, or live-photo variant.
|
||||
Type PaidMediaType `json:"type,omitempty"`
|
||||
|
||||
Width int `json:"width,omitempty"`
|
||||
Height int `json:"height,omitempty"`
|
||||
// Width Optional. Media width as defined by the sender
|
||||
Width int `json:"width,omitempty"`
|
||||
// Height Optional. Media height as defined by the sender
|
||||
Height int `json:"height,omitempty"`
|
||||
// Duration Optional. Duration of the media in seconds as defined by the sender
|
||||
Duration int `json:"duration,omitempty"`
|
||||
|
||||
// Photo The photo
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
|
||||
Video *Video `json:"video,omitempty"`
|
||||
// Video The video
|
||||
Video *Video `json:"video,omitempty"`
|
||||
// LivePhoto The photo
|
||||
LivePhoto *LivePhoto `json:"live_photo,omitempty"` // Since: Bot API 10.0
|
||||
}
|
||||
|
||||
// Contact represents a phone contact.
|
||||
// Since: Bot API 1.0
|
||||
type Contact struct {
|
||||
// PhoneNumber Contact's phone number
|
||||
PhoneNumber string `json:"phone_number"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name,omitempty"`
|
||||
UserID int64 `json:"user_id,omitempty"`
|
||||
Vcard string `json:"vcard,omitempty"`
|
||||
// FirstName Contact's first name
|
||||
FirstName string `json:"first_name"`
|
||||
// LastName Optional. Contact's last name
|
||||
LastName string `json:"last_name,omitempty"`
|
||||
// UserID Optional. Contact's user identifier in Telegram. This number may have more than 32 significant
|
||||
// bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at
|
||||
// most 52 significant bits, so a 64-bit integer or double-precision float type are safe for storing this
|
||||
// identifier.
|
||||
UserID int64 `json:"user_id,omitempty"`
|
||||
// Vcard Optional. Additional data about the contact in the form of a vCard
|
||||
Vcard string `json:"vcard,omitempty"`
|
||||
}
|
||||
|
||||
// Dice represents an animated emoji with a random value.
|
||||
// Since: Bot API 4.7
|
||||
type Dice struct {
|
||||
// Emoji Emoji on which the dice throw animation is based
|
||||
Emoji string `json:"emoji"`
|
||||
Value int `json:"value"`
|
||||
// Value Value of the dice, 1-6 for “”, “” and “” base emoji, 1-5 for “” and “” base
|
||||
// emoji, 1-64 for “” base emoji
|
||||
Value int `json:"value"`
|
||||
}
|
||||
|
||||
// PollOption contains information about one answer option in a poll.
|
||||
// Since: Bot API 4.2
|
||||
// See https://core.telegram.org/bots/api#polloption
|
||||
type PollOption struct {
|
||||
PersistentID string `json:"persistent_id"` // Since: Bot API 9.6
|
||||
Text string `json:"text"`
|
||||
// PersistentID Unique identifier of the option, persistent on option addition and deletion
|
||||
PersistentID string `json:"persistent_id"` // Since: Bot API 9.6
|
||||
// Text Option text, 1-100 characters
|
||||
Text string `json:"text"`
|
||||
// TextEntities Optional. Special entities that appear in the option text. Currently, only custom emoji
|
||||
// entities are allowed in poll option texts
|
||||
TextEntities []MessageEntity `json:"text_entities"`
|
||||
Media *PollMedia `json:"media,omitempty"` // Since: Bot API 10.0
|
||||
VoterCount int `json:"voter_count"`
|
||||
// Media Optional. Media added to the poll option
|
||||
Media *PollMedia `json:"media,omitempty"` // Since: Bot API 10.0
|
||||
// VoterCount Number of users who voted for this option; may be 0 if unknown
|
||||
VoterCount int `json:"voter_count"`
|
||||
|
||||
AddedByUser *User `json:"added_by_user,omitempty"` // Since: Bot API 9.6
|
||||
AddedByChat *Chat `json:"added_by_chat,omitempty"` // Since: Bot API 9.6
|
||||
AdditionDate int `json:"addition_date,omitempty"` // Since: Bot API 9.6
|
||||
// AddedByUser Optional. User who added the option; omitted if the option wasn't added by a user after poll
|
||||
// creation
|
||||
AddedByUser *User `json:"added_by_user,omitempty"` // Since: Bot API 9.6
|
||||
// AddedByChat Optional. Chat that added the option; omitted if the option wasn't added by a chat after poll
|
||||
// creation
|
||||
AddedByChat *Chat `json:"added_by_chat,omitempty"` // Since: Bot API 9.6
|
||||
// AdditionDate Optional. Point in time (Unix timestamp) when the option was added; omitted if the option
|
||||
// existed in the original poll
|
||||
AdditionDate int `json:"addition_date,omitempty"` // Since: Bot API 9.6
|
||||
}
|
||||
|
||||
// InputPollOptionMedia describes the media to attach to a poll option.
|
||||
@@ -174,7 +280,9 @@ type PollOption struct {
|
||||
// Since: Bot API 10.0
|
||||
// See https://core.telegram.org/bots/api#inputpolloptionmedia
|
||||
type InputPollOptionMedia struct {
|
||||
Type string `json:"type"`
|
||||
// Type identifies the poll-option media variant.
|
||||
Type string `json:"type"`
|
||||
// Media is the file_id or URL of the option media for non-link variants.
|
||||
Media string `json:"media,omitempty"`
|
||||
// URL contains the HTTP URL.
|
||||
URL string `json:"url,omitempty"` // Since: Bot API 10.1; for type "link"
|
||||
@@ -184,36 +292,55 @@ type InputPollOptionMedia struct {
|
||||
// Since: Bot API 7.3
|
||||
// See https://core.telegram.org/bots/api#inputpolloption
|
||||
type InputPollOption struct {
|
||||
Text string `json:"text"`
|
||||
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
Media *InputPollOptionMedia `json:"media,omitempty"` // Since: Bot API 10.0
|
||||
// Text Option text, 1-100 characters
|
||||
Text string `json:"text"`
|
||||
// TextParseMode Optional. Mode for parsing entities in the text. See formatting options for more details.
|
||||
// Currently, only custom emoji entities are allowed.
|
||||
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
|
||||
// TextEntities Optional. A JSON-serialized list of special entities that appear in the poll option text. It
|
||||
// can be specified instead of text_parse_mode.
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
// Media Optional. Media added to the poll option
|
||||
Media *InputPollOptionMedia `json:"media,omitempty"` // Since: Bot API 10.0
|
||||
}
|
||||
|
||||
// InputPollMedia describes the media to attach to a poll or its explanation.
|
||||
// Since: Bot API 10.0
|
||||
// See https://core.telegram.org/bots/api#inputpollmedia
|
||||
type InputPollMedia struct {
|
||||
Type string `json:"type"`
|
||||
// Type identifies the poll-media variant.
|
||||
Type string `json:"type"`
|
||||
// Media is the file_id or URL of the poll media.
|
||||
Media string `json:"media"`
|
||||
}
|
||||
|
||||
// PollOptionAdded describes a service message about a poll option being added.
|
||||
// Since: Bot API 9.6
|
||||
type PollOptionAdded struct {
|
||||
PollMessage *InaccessibleMessage `json:"poll_message,omitempty"`
|
||||
OptionPersistentID string `json:"option_persistent_id"`
|
||||
OptionText string `json:"option_text"`
|
||||
OptionTextEntities []MessageEntity `json:"option_text_entities,omitempty"`
|
||||
// PollMessage Optional. Message containing the poll to which the option was added, if known. Note that the
|
||||
// Message object in this field will not contain the reply_to_message field even if it itself is a reply.
|
||||
PollMessage *InaccessibleMessage `json:"poll_message,omitempty"`
|
||||
// OptionPersistentID Unique identifier of the added option
|
||||
OptionPersistentID string `json:"option_persistent_id"`
|
||||
// OptionText Option text
|
||||
OptionText string `json:"option_text"`
|
||||
// OptionTextEntities Optional. Special entities that appear in the option_text
|
||||
OptionTextEntities []MessageEntity `json:"option_text_entities,omitempty"`
|
||||
}
|
||||
|
||||
// PollOptionDeleted describes a service message about a poll option being deleted.
|
||||
// Since: Bot API 9.6
|
||||
type PollOptionDeleted struct {
|
||||
PollMessage *InaccessibleMessage `json:"poll_message,omitempty"`
|
||||
OptionPersistentID string `json:"option_persistent_id"`
|
||||
OptionText string `json:"option_text"`
|
||||
OptionTextEntities []MessageEntity `json:"option_text_entities,omitempty"`
|
||||
// PollMessage Optional. Message containing the poll from which the option was deleted, if known. Note that
|
||||
// the Message object in this field will not contain the reply_to_message field even if it itself is a
|
||||
// reply.
|
||||
PollMessage *InaccessibleMessage `json:"poll_message,omitempty"`
|
||||
// OptionPersistentID Unique identifier of the deleted option
|
||||
OptionPersistentID string `json:"option_persistent_id"`
|
||||
// OptionText Option text
|
||||
OptionText string `json:"option_text"`
|
||||
// OptionTextEntities Optional. Special entities that appear in the option_text
|
||||
OptionTextEntities []MessageEntity `json:"option_text_entities,omitempty"`
|
||||
}
|
||||
|
||||
// PollType represents the type of a poll.
|
||||
@@ -226,43 +353,102 @@ const (
|
||||
PollTypeQuiz PollType = "quiz"
|
||||
)
|
||||
|
||||
// PollAnswer represents an answer of a user in a poll.
|
||||
// PollAnswer represents an answer submitted by a poll voter.
|
||||
//
|
||||
// User and VoterChat remain value fields for v1 compatibility. Their pointer
|
||||
// representation is subject to change in v2; use VoterUser and VoterChatInfo
|
||||
// when presence matters.
|
||||
// Since: Bot API 4.6
|
||||
// See https://core.telegram.org/bots/api#pollanswer
|
||||
type PollAnswer struct {
|
||||
PollID string `json:"poll_id"`
|
||||
VoterChat Chat `json:"voter_chat,omitempty"` // Since: Bot API 6.8
|
||||
User User `json:"user,omitempty"` // FIXME: Pointer in v2
|
||||
OptionIDs []int `json:"option_ids"`
|
||||
// PollID identifies the poll.
|
||||
PollID string `json:"poll_id"`
|
||||
// VoterChat is the chat that changed the answer, when the voter is anonymous.
|
||||
VoterChat Chat `json:"voter_chat,omitempty"` // Since: Bot API 6.8
|
||||
// User is the user that changed the answer, when the voter is not anonymous.
|
||||
User User `json:"user,omitempty"`
|
||||
// OptionIDs contains the chosen option indices and is empty for a retracted vote.
|
||||
OptionIDs []int `json:"option_ids"`
|
||||
// OptionPersistentIDs contains the persistent identifiers of the chosen options.
|
||||
OptionPersistentIDs []string `json:"option_persistent_ids"` // Since: Bot API 9.6
|
||||
}
|
||||
|
||||
// VoterUser returns the non-anonymous voter when it is present.
|
||||
//
|
||||
// Since: Bot API 4.6
|
||||
func (a PollAnswer) VoterUser() (*User, bool) {
|
||||
if a.User.ID == 0 {
|
||||
return nil, false
|
||||
}
|
||||
return &a.User, true
|
||||
}
|
||||
|
||||
// VoterChatInfo returns the anonymous voter chat when it is present.
|
||||
//
|
||||
// Since: Bot API 6.8
|
||||
func (a PollAnswer) VoterChatInfo() (*Chat, bool) {
|
||||
if a.VoterChat.ID == 0 {
|
||||
return nil, false
|
||||
}
|
||||
return &a.VoterChat, true
|
||||
}
|
||||
|
||||
// Poll contains information about a poll.
|
||||
// Since: Bot API 4.2
|
||||
// See https://core.telegram.org/bots/api#poll
|
||||
type Poll struct {
|
||||
ID string `json:"id"`
|
||||
Question string `json:"question"`
|
||||
// ID Unique poll identifier
|
||||
ID string `json:"id"`
|
||||
// Question Poll question, 1-300 characters
|
||||
Question string `json:"question"`
|
||||
// QuestionEntities Optional. Special entities that appear in the question. Currently, only custom emoji
|
||||
// entities are allowed in poll questions
|
||||
QuestionEntities []MessageEntity `json:"question_entities"` // Since: Bot API 7.3
|
||||
Options []PollOption `json:"options"`
|
||||
TotalVoterCount int `json:"total_voter_count"`
|
||||
IsClosed bool `json:"is_closed,omitempty"`
|
||||
IsAnonymous bool `json:"is_anonymous,omitempty"`
|
||||
Type PollType `json:"type"`
|
||||
// Options List of poll options
|
||||
Options []PollOption `json:"options"`
|
||||
// TotalVoterCount Total number of users that voted in the poll
|
||||
TotalVoterCount int `json:"total_voter_count"`
|
||||
// IsClosed True, if the poll is closed
|
||||
IsClosed bool `json:"is_closed,omitempty"`
|
||||
// IsAnonymous True, if the poll is anonymous
|
||||
IsAnonymous bool `json:"is_anonymous,omitempty"`
|
||||
// Type Poll type, currently can be “regular” or “quiz”
|
||||
Type PollType `json:"type"`
|
||||
|
||||
AllowsMultipleAnswers bool `json:"allows_multiple_answers,omitempty"` // Since: Bot API 4.6
|
||||
AllowsRevoting bool `json:"allows_revoting,omitempty"` // Since: Bot API 9.6
|
||||
MembersOnly bool `json:"members_only,omitempty"` // Since: Bot API 10.0
|
||||
CountryCodes []string `json:"country_codes,omitempty"` // Since: Bot API 10.0
|
||||
CorrectOptionIDs []int `json:"correct_option_ids,omitempty"` // Since: Bot API 9.6
|
||||
Explanation string `json:"explanation,omitempty"` // Since: Bot API 4.8
|
||||
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` // Since: Bot API 4.8
|
||||
ExplanationMedia *PollMedia `json:"explanation_media,omitempty"` // Since: Bot API 10.0
|
||||
OpenPeriod int `json:"open_period,omitempty"` // Since: Bot API 4.8
|
||||
CloseDate int `json:"close_date,omitempty"` // Since: Bot API 4.8
|
||||
Description string `json:"description,omitempty"` // Since: Bot API 9.6
|
||||
DescriptionEntities []MessageEntity `json:"description_entities,omitempty"` // Since: Bot API 9.6
|
||||
Media *PollMedia `json:"media,omitempty"` // Since: Bot API 10.0
|
||||
// AllowsMultipleAnswers True, if the poll allows multiple answers
|
||||
AllowsMultipleAnswers bool `json:"allows_multiple_answers,omitempty"` // Since: Bot API 4.6
|
||||
// AllowsRevoting True, if the poll allows to change the chosen answer options
|
||||
AllowsRevoting bool `json:"allows_revoting,omitempty"` // Since: Bot API 9.6
|
||||
// MembersOnly True if voting is limited to users who have been members of the chat where the poll was
|
||||
// originally sent for more than 24 hours
|
||||
MembersOnly bool `json:"members_only,omitempty"` // Since: Bot API 10.0
|
||||
// CountryCodes Optional. A list of two-letter ISO 3166-1 alpha-2 country codes indicating the countries
|
||||
// from which users can vote in the poll. The country code “FT” is used for users with anonymous
|
||||
// numbers. If omitted, then users from any country can participate in the poll.
|
||||
CountryCodes []string `json:"country_codes,omitempty"` // Since: Bot API 10.0
|
||||
// CorrectOptionIDs Optional. Array of 0-based identifiers of the correct answer options. Available only for
|
||||
// polls in quiz mode which are closed or were sent (not forwarded) by the bot or to the private chat with
|
||||
// the bot.
|
||||
CorrectOptionIDs []int `json:"correct_option_ids,omitempty"` // Since: Bot API 9.6
|
||||
// Explanation Optional. Text that is shown when a user chooses an incorrect answer or taps on the lamp icon
|
||||
// in a quiz-style poll, 0-200 characters
|
||||
Explanation string `json:"explanation,omitempty"` // Since: Bot API 4.8
|
||||
// ExplanationEntities Optional. Special entities like usernames, URLs, bot commands, etc. that appear in
|
||||
// the explanation
|
||||
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"` // Since: Bot API 4.8
|
||||
// ExplanationMedia Optional. Media added to the quiz explanation
|
||||
ExplanationMedia *PollMedia `json:"explanation_media,omitempty"` // Since: Bot API 10.0
|
||||
// OpenPeriod Optional. Amount of time in seconds the poll will be active after creation
|
||||
OpenPeriod int `json:"open_period,omitempty"` // Since: Bot API 4.8
|
||||
// CloseDate Optional. Point in time (Unix timestamp) when the poll will be automatically closed
|
||||
CloseDate int `json:"close_date,omitempty"` // Since: Bot API 4.8
|
||||
// Description Optional. Description of the poll; for polls inside the Message object only
|
||||
Description string `json:"description,omitempty"` // Since: Bot API 9.6
|
||||
// DescriptionEntities Optional. Special entities like usernames, URLs, bot commands, etc. that appear in
|
||||
// the description
|
||||
DescriptionEntities []MessageEntity `json:"description_entities,omitempty"` // Since: Bot API 9.6
|
||||
// Media Optional. Media added to the poll description; for polls inside the Message object only
|
||||
Media *PollMedia `json:"media,omitempty"` // Since: Bot API 10.0
|
||||
}
|
||||
|
||||
// Link represents an HTTP link.
|
||||
@@ -276,73 +462,121 @@ type Link struct {
|
||||
// PollMedia represents media attached to a poll.
|
||||
// Since: Bot API 10.0
|
||||
type PollMedia struct {
|
||||
// Animation Optional. Media is an animation, information about the animation
|
||||
Animation *Animation `json:"animation,omitempty"`
|
||||
Audio *Audio `json:"audio,omitempty"`
|
||||
Document *Document `json:"document,omitempty"`
|
||||
// Audio Optional. Media is an audio file, information about the file; currently, can't be received in a
|
||||
// poll option
|
||||
Audio *Audio `json:"audio,omitempty"`
|
||||
// Document Optional. Media is a general file, information about the file; currently, can't be received in a
|
||||
// poll option
|
||||
Document *Document `json:"document,omitempty"`
|
||||
// Link contains link media attached to the poll.
|
||||
Link *Link `json:"link,omitempty"` // Since: Bot API 10.1
|
||||
LivePhoto *LivePhoto `json:"live_photo,omitempty"`
|
||||
Location *Location `json:"location,omitempty"`
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
Sticker *Sticker `json:"sticker,omitempty"`
|
||||
Venue *Venue `json:"venue,omitempty"`
|
||||
Video *Video `json:"video,omitempty"`
|
||||
Link *Link `json:"link,omitempty"` // Since: Bot API 10.1
|
||||
// LivePhoto Optional. Media is a live photo, information about the live photo
|
||||
LivePhoto *LivePhoto `json:"live_photo,omitempty"`
|
||||
// Location Optional. Media is a shared location, information about the location
|
||||
Location *Location `json:"location,omitempty"`
|
||||
// Photo Optional. Media is a photo, available sizes of the photo
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
// Sticker Optional. Media is a sticker, information about the sticker; currently, for poll options only
|
||||
Sticker *Sticker `json:"sticker,omitempty"`
|
||||
// Venue Optional. Media is a venue, information about the venue
|
||||
Venue *Venue `json:"venue,omitempty"`
|
||||
// Video Optional. Media is a video, information about the video
|
||||
Video *Video `json:"video,omitempty"`
|
||||
}
|
||||
|
||||
// ChecklistTask represents a single task in a checklist.
|
||||
// Since: Bot API 9.1
|
||||
type ChecklistTask struct {
|
||||
ID int `json:"id"`
|
||||
Text string `json:"text"`
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
CompletedByUser *User `json:"completed_by_user,omitempty"`
|
||||
CompletedByChat *Chat `json:"completed_by_chat,omitempty"`
|
||||
CompletionDate int `json:"completion_date,omitempty"`
|
||||
// ID Unique identifier of the task
|
||||
ID int `json:"id"`
|
||||
// Text Text of the task
|
||||
Text string `json:"text"`
|
||||
// TextEntities Optional. Special entities that appear in the task text
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
// CompletedByUser Optional. User that completed the task; omitted if the task wasn't completed by a user
|
||||
CompletedByUser *User `json:"completed_by_user,omitempty"`
|
||||
// CompletedByChat Optional. Chat that completed the task; omitted if the task wasn't completed by a chat
|
||||
CompletedByChat *Chat `json:"completed_by_chat,omitempty"`
|
||||
// CompletionDate Optional. Point in time (Unix timestamp) when the task was completed; 0 if the task wasn't
|
||||
// completed
|
||||
CompletionDate int `json:"completion_date,omitempty"`
|
||||
}
|
||||
|
||||
// Checklist represents a checklist.
|
||||
// Since: Bot API 9.1
|
||||
type Checklist struct {
|
||||
Title string `json:"title"`
|
||||
TitleEntities []MessageEntity `json:"title_entities,omitempty"`
|
||||
Tasks []ChecklistTask `json:"tasks"`
|
||||
OthersCanAddTasks bool `json:"others_can_add_tasks,omitempty"`
|
||||
OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"`
|
||||
// Title Title of the checklist
|
||||
Title string `json:"title"`
|
||||
// TitleEntities Optional. Special entities that appear in the checklist title
|
||||
TitleEntities []MessageEntity `json:"title_entities,omitempty"`
|
||||
// Tasks List of tasks in the checklist
|
||||
Tasks []ChecklistTask `json:"tasks"`
|
||||
// OthersCanAddTasks Optional. True, if users other than the creator of the list can add tasks to the list
|
||||
OthersCanAddTasks bool `json:"others_can_add_tasks,omitempty"`
|
||||
// OthersCanMarkTasksAsDone Optional. True, if users other than the creator of the list can mark tasks as
|
||||
// done or not done
|
||||
OthersCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"`
|
||||
}
|
||||
|
||||
// InputChecklistTask describes a task in a checklist.
|
||||
// Since: Bot API 9.1
|
||||
type InputChecklistTask struct {
|
||||
ID int `json:"id"`
|
||||
Text string `json:"text"`
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
// ID Unique identifier of the task; must be positive and unique among all task identifiers currently
|
||||
// present in the checklist
|
||||
ID int `json:"id"`
|
||||
// Text Text of the task; 1-100 characters after entities parsing
|
||||
Text string `json:"text"`
|
||||
// ParseMode Optional. Mode for parsing entities in the text. See formatting options for more details.
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
// TextEntities Optional. List of special entities that appear in the text, which can be specified instead
|
||||
// of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and
|
||||
// date_time entities are allowed.
|
||||
TextEntities []MessageEntity `json:"text_entities,omitempty"`
|
||||
}
|
||||
|
||||
// InputChecklist represents a checklist to be sent.
|
||||
// Since: Bot API 9.1
|
||||
type InputChecklist struct {
|
||||
Title string `json:"title"`
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
TitleEntities []MessageEntity `json:"title_entities,omitempty"`
|
||||
Tasks []InputChecklistTask `json:"tasks"`
|
||||
OtherCanAddTasks bool `json:"other_can_add_tasks,omitempty"`
|
||||
OtherCanMarkTasksAsDone bool `json:"other_can_mark_tasks_as_done,omitempty"`
|
||||
// Title Title of the checklist; 1-255 characters after entities parsing
|
||||
Title string `json:"title"`
|
||||
// ParseMode Optional. Mode for parsing entities in the title. See formatting options for more details.
|
||||
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
||||
// TitleEntities Optional. List of special entities that appear in the title, which can be specified instead
|
||||
// of parse_mode. Currently, only bold, italic, underline, strikethrough, spoiler, custom_emoji, and
|
||||
// date_time entities are allowed.
|
||||
TitleEntities []MessageEntity `json:"title_entities,omitempty"`
|
||||
// Tasks List of 1-30 tasks in the checklist
|
||||
Tasks []InputChecklistTask `json:"tasks"`
|
||||
// OtherCanAddTasks Optional. Pass True if other users can add tasks to the checklist
|
||||
// Subject to change in v2: the Go field name may be corrected to OthersCanAddTasks.
|
||||
OtherCanAddTasks bool `json:"others_can_add_tasks,omitempty"`
|
||||
// OtherCanMarkTasksAsDone Optional. Pass True if other users can mark tasks as done or not done in the
|
||||
// checklist
|
||||
// Subject to change in v2: the Go field name may be corrected to OthersCanMarkTasksAsDone.
|
||||
OtherCanMarkTasksAsDone bool `json:"others_can_mark_tasks_as_done,omitempty"`
|
||||
}
|
||||
|
||||
// ChecklistTaskDone describes a service message about checklist tasks being marked as done.
|
||||
// Since: Bot API 9.1
|
||||
type ChecklistTaskDone struct {
|
||||
ChecklistMessage *Message `json:"checklist_message,omitempty"`
|
||||
MarkedAsDoneTaskIDs []int `json:"marked_as_done_task_ids,omitempty"`
|
||||
MarkedAsNotDoneTaskIDs []int `json:"marked_as_not_done_task_ids,omitempty"`
|
||||
// ChecklistMessage is the checklist message when it is available.
|
||||
ChecklistMessage *Message `json:"checklist_message,omitempty"`
|
||||
// MarkedAsDoneTaskIDs Optional. Identifiers of the tasks that were marked as done
|
||||
MarkedAsDoneTaskIDs []int `json:"marked_as_done_task_ids,omitempty"`
|
||||
// MarkedAsNotDoneTaskIDs Optional. Identifiers of the tasks that were marked as not done
|
||||
MarkedAsNotDoneTaskIDs []int `json:"marked_as_not_done_task_ids,omitempty"`
|
||||
}
|
||||
|
||||
// ChecklistTasksAdded describes a service message about new checklist tasks being added.
|
||||
// Since: Bot API 9.1
|
||||
type ChecklistTasksAdded struct {
|
||||
ChecklistMessage *Message `json:"checklist_message,omitempty"`
|
||||
Tasks []ChecklistTask `json:"tasks"`
|
||||
// ChecklistMessage Optional. Message containing the checklist to which the tasks were added. Note that the
|
||||
// Message object in this field will not contain the reply_to_message field even if it itself is a reply.
|
||||
ChecklistMessage *Message `json:"checklist_message,omitempty"`
|
||||
// Tasks List of tasks added to the checklist
|
||||
Tasks []ChecklistTask `json:"tasks"`
|
||||
}
|
||||
|
||||
// InputMediaType represents the type of input media.
|
||||
@@ -378,35 +612,64 @@ const (
|
||||
// Since: Bot API 4.0
|
||||
// See https://core.telegram.org/bots/api#inputmedia
|
||||
type InputMedia struct {
|
||||
Type InputMediaType `json:"type"`
|
||||
Media string `json:"media"`
|
||||
// Type identifies the concrete input-media variant.
|
||||
Type InputMediaType `json:"type"`
|
||||
// Media is a file_id, HTTP URL, or attach:// reference for the media.
|
||||
Media string `json:"media"`
|
||||
|
||||
Caption *string `json:"caption,omitempty"`
|
||||
ParseMode *ParseMode `json:"parse_mode,omitempty"`
|
||||
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
|
||||
ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // Since: Bot API 7.4
|
||||
HasSpoiler *bool `json:"has_spoiler,omitempty"` // Since: Bot API 6.4
|
||||
// Caption is the optional media caption.
|
||||
Caption *string `json:"caption,omitempty"`
|
||||
// ParseMode selects how entities in Caption are parsed.
|
||||
ParseMode *ParseMode `json:"parse_mode,omitempty"`
|
||||
// CaptionEntities Optional. List of special entities that appear in the caption, which can be specified
|
||||
// instead of parse_mode
|
||||
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
|
||||
// ShowCaptionAboveMedia Optional. Pass True if the caption must be shown above the message media
|
||||
ShowCaptionAboveMedia *bool `json:"show_caption_above_media,omitempty"` // Since: Bot API 7.4
|
||||
// HasSpoiler requests that supported media be covered by a spoiler animation.
|
||||
HasSpoiler *bool `json:"has_spoiler,omitempty"` // Since: Bot API 6.4
|
||||
|
||||
Cover *string `json:"cover"` // Since: Bot API 8.3
|
||||
StartTimestamp *int `json:"start_timestamp"` // Since: Bot API 8.3
|
||||
Width *int `json:"width,omitempty"`
|
||||
Height *int `json:"height,omitempty"`
|
||||
Duration *int `json:"duration,omitempty"`
|
||||
SupportsStreaming *bool `json:"supports_streaming,omitempty"`
|
||||
// Cover Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the
|
||||
// Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
||||
// “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name>
|
||||
// name. More information on Sending Files »
|
||||
Cover *string `json:"cover"` // Since: Bot API 8.3
|
||||
// StartTimestamp Optional. Start timestamp for the video in the message
|
||||
StartTimestamp *int `json:"start_timestamp"` // Since: Bot API 8.3
|
||||
// Width is the optional media width in pixels.
|
||||
Width *int `json:"width,omitempty"`
|
||||
// Height is the optional media height in pixels.
|
||||
Height *int `json:"height,omitempty"`
|
||||
// Duration is the optional duration of the media in seconds.
|
||||
Duration *int `json:"duration,omitempty"`
|
||||
// SupportsStreaming Optional. Pass True if the uploaded video is suitable for streaming
|
||||
SupportsStreaming *bool `json:"supports_streaming,omitempty"`
|
||||
|
||||
// Performer Optional. Performer of the audio
|
||||
Performer *string `json:"performer,omitempty"`
|
||||
Title *string `json:"title,omitempty"`
|
||||
// Title is the optional title of audio or venue media.
|
||||
Title *string `json:"title,omitempty"`
|
||||
|
||||
// Emoji Optional. Emoji associated with the sticker; only for just uploaded stickers
|
||||
Emoji *string `json:"emoji,omitempty"`
|
||||
|
||||
Latitude *float64 `json:"latitude,omitempty"`
|
||||
Longitude *float64 `json:"longitude,omitempty"`
|
||||
Address *string `json:"address,omitempty"`
|
||||
FoursquareID *string `json:"foursquare_id,omitempty"`
|
||||
FoursquareType *string `json:"foursquare_type,omitempty"`
|
||||
GooglePlaceID *string `json:"google_place_id,omitempty"`
|
||||
GooglePlaceType *string `json:"google_place_type,omitempty"`
|
||||
// Latitude Latitude of the location
|
||||
Latitude *float64 `json:"latitude,omitempty"`
|
||||
// Longitude Longitude of the location
|
||||
Longitude *float64 `json:"longitude,omitempty"`
|
||||
// Address Address of the venue
|
||||
Address *string `json:"address,omitempty"`
|
||||
// FoursquareID Optional. Foursquare identifier of the venue
|
||||
FoursquareID *string `json:"foursquare_id,omitempty"`
|
||||
// FoursquareType Optional. Foursquare type of the venue, if known. (For example,
|
||||
// “arts_entertainment/default”, “arts_entertainment/aquarium” or “food/icecream”.)
|
||||
FoursquareType *string `json:"foursquare_type,omitempty"`
|
||||
// GooglePlaceID Optional. Google Places identifier of the venue
|
||||
GooglePlaceID *string `json:"google_place_id,omitempty"`
|
||||
// GooglePlaceType Optional. Google Places type of the venue. (See supported types.)
|
||||
GooglePlaceType *string `json:"google_place_type,omitempty"`
|
||||
|
||||
// HorizontalAccuracy Optional. The radius of uncertainty for the location, measured in meters; 0-1500
|
||||
HorizontalAccuracy *float64 `json:"horizontal_accuracy,omitempty"`
|
||||
}
|
||||
|
||||
@@ -426,37 +689,65 @@ const (
|
||||
// Since: Bot API 7.6
|
||||
// See https://core.telegram.org/bots/api#inputpaidmedia
|
||||
type InputPaidMedia struct {
|
||||
Type InputPaidMediaType `json:"type"`
|
||||
Media string `json:"media"`
|
||||
// Type identifies the concrete paid-media variant.
|
||||
Type InputPaidMediaType `json:"type"`
|
||||
// Media is a file_id, HTTP URL, or attach:// reference for the paid media.
|
||||
Media string `json:"media"`
|
||||
|
||||
Cover *string `json:"cover,omitempty"` // Since: Bot API 8.3
|
||||
StartTimestamp *int64 `json:"start_timestamp,omitempty"` // Since: Bot API 8.3
|
||||
Width *int `json:"width,omitempty"`
|
||||
Height *int `json:"height,omitempty"`
|
||||
Duration *int `json:"duration,omitempty"`
|
||||
SupportsStreaming *bool `json:"supports_streaming,omitempty"`
|
||||
// Cover Optional. Cover for the video in the message. Pass a file_id to send a file that exists on the
|
||||
// Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass
|
||||
// “attach://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name>
|
||||
// name. More information on Sending Files »
|
||||
Cover *string `json:"cover,omitempty"` // Since: Bot API 8.3
|
||||
// StartTimestamp Optional. Start timestamp for the video in the message
|
||||
StartTimestamp *int64 `json:"start_timestamp,omitempty"` // Since: Bot API 8.3
|
||||
// Width Optional. Video width
|
||||
Width *int `json:"width,omitempty"`
|
||||
// Height Optional. Video height
|
||||
Height *int `json:"height,omitempty"`
|
||||
// Duration Optional. Video duration in seconds
|
||||
Duration *int `json:"duration,omitempty"`
|
||||
// SupportsStreaming Optional. Pass True if the uploaded video is suitable for streaming
|
||||
SupportsStreaming *bool `json:"supports_streaming,omitempty"`
|
||||
}
|
||||
|
||||
// PhotoSize represents one size of a photo or a file/sticker thumbnail.
|
||||
// Since: Bot API 1.0
|
||||
// See https://core.telegram.org/bots/api#photosize
|
||||
type PhotoSize struct {
|
||||
FileID string `json:"file_id"`
|
||||
// FileID Identifier for this file, which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for this file, which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// Width Photo width
|
||||
Width int `json:"width"`
|
||||
// Height Photo height
|
||||
Height int `json:"height"`
|
||||
// FileSize Optional. File size in bytes
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
// LivePhoto represents a live photo (a photo with a short video attached).
|
||||
// Since: Bot API 10.0
|
||||
type LivePhoto struct {
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
FileID string `json:"file_id"`
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
Width int `json:"width"`
|
||||
Height int `json:"height"`
|
||||
Duration int `json:"duration"`
|
||||
MIMEType string `json:"mime_type,omitempty"`
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
// Photo Optional. Available sizes of the corresponding static photo
|
||||
Photo []PhotoSize `json:"photo,omitempty"`
|
||||
// FileID Identifier for the video file which can be used to download or reuse the file
|
||||
FileID string `json:"file_id"`
|
||||
// FileUniqueID Unique identifier for the video file which is supposed to be the same over time and for
|
||||
// different bots. Can't be used to download or reuse the file.
|
||||
FileUniqueID string `json:"file_unique_id"`
|
||||
// Width Video width as defined by the sender
|
||||
Width int `json:"width"`
|
||||
// Height Video height as defined by the sender
|
||||
Height int `json:"height"`
|
||||
// Duration Duration of the video in seconds as defined by the sender
|
||||
Duration int `json:"duration"`
|
||||
// MIMEType Optional. MIME type of the file as defined by the sender
|
||||
MIMEType string `json:"mime_type,omitempty"`
|
||||
// FileSize Optional. File size in bytes. It can be bigger than 2^31 and some programming languages may have
|
||||
// difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit
|
||||
// integer or double-precision float type are safe for storing this value.
|
||||
FileSize int64 `json:"file_size,omitempty"`
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user