feat(api): typed enums for all string-enum fields

The Telegram docs describe many string fields and parameters with
phrases like "can be ..., or ...", "must be one of ...", or "always X",
yet the generated Go API surface used raw `string` for every one of
them. Callers had to write magic strings or `string(api.ChatTypePrivate)`
to satisfy the field type. This change makes those fields typed Go
string enums emitted from the IR, so the IDE autocompletes valid values
and breaking-value drift surfaces at compile time.

Pipeline changes:

- internal/spec/ir.go: Field gains EnumValues []string. Empty for non-
  enum fields; otherwise the wire-level values in doc order, deduped.

- cmd/scrape/enums.go: extractEnumValues recognises the curly-quoted
  patterns Telegram uses ("can be either", "currently can be", "one
  of", "must be", "always X") and rejects free-text quoted refs (e.g.
  "Can be available only for X") via a tight gap check between the
  trigger phrase and the first quoted value. parse_mode parameters
  get the canonical Markdown / MarkdownV2 / HTML triple injected
  because Telegram links to a separate formatting-options section
  instead of listing values inline.

- cmd/genapi/enums.go: planEnums groups fields by sorted value-tuple,
  picks a canonical Go enum name (most-common candidate, parent-
  prefixed beats plain, shortest beats longer, alphabetical for
  determinism), resolves cross-group name collisions by parent prefix.

- cmd/genapi/emitter.go + templates: goField rewrites the field type
  to the planned enum name; multipartFieldEntry casts typed enum
  values back to string when composing the wire map; enums.tmpl now
  iterates the planned enums instead of hardcoding four hand-curated
  ones; sentinelForField produces typed-constant test fixtures.

- api/enums.gen.go: regenerated from the live IR. 66 enum types, 155
  constants. ParseMode, ChatType, MessageEntityType, ChatMember /
  MessageOrigin / PaidMedia / Background / StoryAreaType / Reaction /
  TransactionPartner / PassportElement variant Status & Type fields
  are now typed.

- api/enums.go: hand-coded UpdateType (used by transport.LongPoller).
  The Telegram docs do not enumerate Update payload kinds inline, so
  the codegen pipeline cannot synthesise this enum.

- api/types.gen.go, api/methods.gen.go, api/methods_gen_test.go: 137
  field declarations rewritten string -> typed enum.

- dispatch/, examples/: dropped every string(api.<Const>) cast. The
  HasEntity filter now takes api.MessageEntityType; ChatType filter
  compares typed values directly. ChatMember discriminator filter
  casts variant.Status (typed per variant) to string for comparison.

- internal/spec/api.json, testdata/golden/*: regenerated and
  refreshed. make regen-from-fixture is byte-deterministic across
  runs.

Renames (no compat shims; v1 pre-public):
- EntityX  -> MessageEntityTypeX  (e.g. EntityBotCommand -> MessageEntityTypeBotCommand)
- EntityStrike -> MessageEntityTypeStrikethrough (full wire name)
This commit is contained in:
2026-05-09 17:55:34 +01:00
parent 1da759ba8a
commit 3c04d7b0b1
32 changed files with 3487 additions and 668 deletions
+463 -33
View File
@@ -4,16 +4,102 @@
package api
// ParseMode controls how Telegram interprets formatting in message text.
type ParseMode string
type BackgroundFillFreeformGradientType string
const (
ParseModeMarkdown ParseMode = "Markdown" // legacy
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
ParseModeHTML ParseMode = "HTML"
BackgroundFillFreeformGradientTypeFreeformGradient BackgroundFillFreeformGradientType = "freeform_gradient"
)
type BackgroundFillGradientType string
const (
BackgroundFillGradientTypeGradient BackgroundFillGradientType = "gradient"
)
type BackgroundFillSolidType string
const (
BackgroundFillSolidTypeSolid BackgroundFillSolidType = "solid"
)
type BackgroundTypeChatThemeType string
const (
BackgroundTypeChatThemeTypeChatTheme BackgroundTypeChatThemeType = "chat_theme"
)
type BackgroundTypeFillType string
const (
BackgroundTypeFillTypeFill BackgroundTypeFillType = "fill"
)
type BackgroundTypePatternType string
const (
BackgroundTypePatternTypePattern BackgroundTypePatternType = "pattern"
)
type BackgroundTypeWallpaperType string
const (
BackgroundTypeWallpaperTypeWallpaper BackgroundTypeWallpaperType = "wallpaper"
)
type ChatBoostSourceGiftCodeSource string
const (
ChatBoostSourceGiftCodeSourceGiftCode ChatBoostSourceGiftCodeSource = "gift_code"
)
type ChatBoostSourceGiveawaySource string
const (
ChatBoostSourceGiveawaySourceGiveaway ChatBoostSourceGiveawaySource = "giveaway"
)
type ChatBoostSourcePremiumSource string
const (
ChatBoostSourcePremiumSourcePremium ChatBoostSourcePremiumSource = "premium"
)
type ChatMemberAdministratorStatus string
const (
ChatMemberAdministratorStatusAdministrator ChatMemberAdministratorStatus = "administrator"
)
type ChatMemberBannedStatus string
const (
ChatMemberBannedStatusKicked ChatMemberBannedStatus = "kicked"
)
type ChatMemberLeftStatus string
const (
ChatMemberLeftStatusLeft ChatMemberLeftStatus = "left"
)
type ChatMemberMemberStatus string
const (
ChatMemberMemberStatusMember ChatMemberMemberStatus = "member"
)
type ChatMemberOwnerStatus string
const (
ChatMemberOwnerStatusCreator ChatMemberOwnerStatus = "creator"
)
type ChatMemberRestrictedStatus string
const (
ChatMemberRestrictedStatusRestricted ChatMemberRestrictedStatus = "restricted"
)
// ChatType is the type of a Telegram chat.
type ChatType string
const (
@@ -23,38 +109,382 @@ const (
ChatTypeChannel ChatType = "channel"
)
// UpdateType identifies an Update payload variant. Used by allowed_updates
// in getUpdates / setWebhook.
type UpdateType string
type EncryptedPassportElementType string
const (
UpdateMessage UpdateType = "message"
UpdateEditedMessage UpdateType = "edited_message"
UpdateChannelPost UpdateType = "channel_post"
UpdateEditedChannelPost UpdateType = "edited_channel_post"
UpdateCallbackQuery UpdateType = "callback_query"
UpdateInlineQuery UpdateType = "inline_query"
EncryptedPassportElementTypePersonalDetails EncryptedPassportElementType = "personal_details"
EncryptedPassportElementTypePassport EncryptedPassportElementType = "passport"
EncryptedPassportElementTypeDriverLicense EncryptedPassportElementType = "driver_license"
EncryptedPassportElementTypeIdentityCard EncryptedPassportElementType = "identity_card"
EncryptedPassportElementTypeInternalPassport EncryptedPassportElementType = "internal_passport"
EncryptedPassportElementTypeAddress EncryptedPassportElementType = "address"
EncryptedPassportElementTypeUtilityBill EncryptedPassportElementType = "utility_bill"
EncryptedPassportElementTypeBankStatement EncryptedPassportElementType = "bank_statement"
EncryptedPassportElementTypeRentalAgreement EncryptedPassportElementType = "rental_agreement"
EncryptedPassportElementTypePassportRegistration EncryptedPassportElementType = "passport_registration"
EncryptedPassportElementTypeTemporaryRegistration EncryptedPassportElementType = "temporary_registration"
EncryptedPassportElementTypePhoneNumber EncryptedPassportElementType = "phone_number"
EncryptedPassportElementTypeEmail EncryptedPassportElementType = "email"
)
type InlineQueryChatType string
const (
InlineQueryChatTypeSender InlineQueryChatType = "sender"
InlineQueryChatTypePrivate InlineQueryChatType = "private"
InlineQueryChatTypeGroup InlineQueryChatType = "group"
InlineQueryChatTypeSupergroup InlineQueryChatType = "supergroup"
InlineQueryChatTypeChannel InlineQueryChatType = "channel"
)
type InlineQueryResultDocumentMimeType string
const (
InlineQueryResultDocumentMimeTypeApplicationOfPdf InlineQueryResultDocumentMimeType = "application/pdf"
InlineQueryResultDocumentMimeTypeApplicationOfZip InlineQueryResultDocumentMimeType = "application/zip"
)
type InlineQueryResultGifThumbnailMimeType string
const (
InlineQueryResultGifThumbnailMimeTypeImageOfJpeg InlineQueryResultGifThumbnailMimeType = "image/jpeg"
InlineQueryResultGifThumbnailMimeTypeImageOfGif InlineQueryResultGifThumbnailMimeType = "image/gif"
InlineQueryResultGifThumbnailMimeTypeVideoOfMp4 InlineQueryResultGifThumbnailMimeType = "video/mp4"
)
type InputStickerFormat string
const (
InputStickerFormatStatic InputStickerFormat = "static"
InputStickerFormatAnimated InputStickerFormat = "animated"
InputStickerFormatVideo InputStickerFormat = "video"
)
type KeyboardButtonStyle string
const (
KeyboardButtonStyleDanger KeyboardButtonStyle = "danger"
KeyboardButtonStyleSuccess KeyboardButtonStyle = "success"
KeyboardButtonStylePrimary KeyboardButtonStyle = "primary"
)
type MaskPositionPoint string
const (
MaskPositionPointForehead MaskPositionPoint = "forehead"
MaskPositionPointEyes MaskPositionPoint = "eyes"
MaskPositionPointMouth MaskPositionPoint = "mouth"
MaskPositionPointChin MaskPositionPoint = "chin"
)
// MessageEntityType is the kind of an entity (mention, hashtag, command, ...).
type MessageEntityType string
const (
EntityMention MessageEntityType = "mention"
EntityHashtag MessageEntityType = "hashtag"
EntityCashtag MessageEntityType = "cashtag"
EntityBotCommand MessageEntityType = "bot_command"
EntityURL MessageEntityType = "url"
EntityEmail MessageEntityType = "email"
EntityPhoneNumber MessageEntityType = "phone_number"
EntityBold MessageEntityType = "bold"
EntityItalic MessageEntityType = "italic"
EntityUnderline MessageEntityType = "underline"
EntityStrike MessageEntityType = "strikethrough"
EntitySpoiler MessageEntityType = "spoiler"
EntityCode MessageEntityType = "code"
EntityPre MessageEntityType = "pre"
EntityTextLink MessageEntityType = "text_link"
EntityTextMention MessageEntityType = "text_mention"
EntityCustomEmoji MessageEntityType = "custom_emoji"
MessageEntityTypeMention MessageEntityType = "mention"
MessageEntityTypeHashtag MessageEntityType = "hashtag"
MessageEntityTypeCashtag MessageEntityType = "cashtag"
MessageEntityTypeBotCommand MessageEntityType = "bot_command"
MessageEntityTypeURL MessageEntityType = "url"
MessageEntityTypeEmail MessageEntityType = "email"
MessageEntityTypePhoneNumber MessageEntityType = "phone_number"
MessageEntityTypeBold MessageEntityType = "bold"
MessageEntityTypeItalic MessageEntityType = "italic"
MessageEntityTypeUnderline MessageEntityType = "underline"
MessageEntityTypeStrikethrough MessageEntityType = "strikethrough"
MessageEntityTypeSpoiler MessageEntityType = "spoiler"
MessageEntityTypeBlockquote MessageEntityType = "blockquote"
MessageEntityTypeExpandableBlockquote MessageEntityType = "expandable_blockquote"
MessageEntityTypeCode MessageEntityType = "code"
MessageEntityTypePre MessageEntityType = "pre"
MessageEntityTypeTextLink MessageEntityType = "text_link"
MessageEntityTypeTextMention MessageEntityType = "text_mention"
MessageEntityTypeCustomEmoji MessageEntityType = "custom_emoji"
MessageEntityTypeDateTime MessageEntityType = "date_time"
)
type MessageOriginChannelType string
const (
MessageOriginChannelTypeChannel MessageOriginChannelType = "channel"
)
type MessageOriginChatType string
const (
MessageOriginChatTypeChat MessageOriginChatType = "chat"
)
type MessageOriginHiddenUserType string
const (
MessageOriginHiddenUserTypeHiddenUser MessageOriginHiddenUserType = "hidden_user"
)
type MessageOriginUserType string
const (
MessageOriginUserTypeUser MessageOriginUserType = "user"
)
type OwnedGiftRegularType string
const (
OwnedGiftRegularTypeRegular OwnedGiftRegularType = "regular"
)
type OwnedGiftUniqueType string
const (
OwnedGiftUniqueTypeUnique OwnedGiftUniqueType = "unique"
)
type PaidMediaLivePhotoType string
const (
PaidMediaLivePhotoTypeLivePhoto PaidMediaLivePhotoType = "live_photo"
)
type PaidMediaPhotoType string
const (
PaidMediaPhotoTypePhoto PaidMediaPhotoType = "photo"
)
type PaidMediaPreviewType string
const (
PaidMediaPreviewTypePreview PaidMediaPreviewType = "preview"
)
type PaidMediaVideoType string
const (
PaidMediaVideoTypeVideo PaidMediaVideoType = "video"
)
type ParseMode string
const (
ParseModeMarkdown ParseMode = "Markdown"
ParseModeMarkdownV2 ParseMode = "MarkdownV2"
ParseModeHTML ParseMode = "HTML"
)
type PassportElementErrorDataFieldType string
const (
PassportElementErrorDataFieldTypePersonalDetails PassportElementErrorDataFieldType = "personal_details"
PassportElementErrorDataFieldTypePassport PassportElementErrorDataFieldType = "passport"
PassportElementErrorDataFieldTypeDriverLicense PassportElementErrorDataFieldType = "driver_license"
PassportElementErrorDataFieldTypeIdentityCard PassportElementErrorDataFieldType = "identity_card"
PassportElementErrorDataFieldTypeInternalPassport PassportElementErrorDataFieldType = "internal_passport"
PassportElementErrorDataFieldTypeAddress PassportElementErrorDataFieldType = "address"
)
type PassportElementErrorFileType string
const (
PassportElementErrorFileTypeUtilityBill PassportElementErrorFileType = "utility_bill"
PassportElementErrorFileTypeBankStatement PassportElementErrorFileType = "bank_statement"
PassportElementErrorFileTypeRentalAgreement PassportElementErrorFileType = "rental_agreement"
PassportElementErrorFileTypePassportRegistration PassportElementErrorFileType = "passport_registration"
PassportElementErrorFileTypeTemporaryRegistration PassportElementErrorFileType = "temporary_registration"
)
type PassportElementErrorReverseSideType string
const (
PassportElementErrorReverseSideTypeDriverLicense PassportElementErrorReverseSideType = "driver_license"
PassportElementErrorReverseSideTypeIdentityCard PassportElementErrorReverseSideType = "identity_card"
)
type PassportElementErrorSelfieType string
const (
PassportElementErrorSelfieTypePassport PassportElementErrorSelfieType = "passport"
PassportElementErrorSelfieTypeDriverLicense PassportElementErrorSelfieType = "driver_license"
PassportElementErrorSelfieTypeIdentityCard PassportElementErrorSelfieType = "identity_card"
PassportElementErrorSelfieTypeInternalPassport PassportElementErrorSelfieType = "internal_passport"
)
type PassportElementErrorTranslationFileType string
const (
PassportElementErrorTranslationFileTypePassport PassportElementErrorTranslationFileType = "passport"
PassportElementErrorTranslationFileTypeDriverLicense PassportElementErrorTranslationFileType = "driver_license"
PassportElementErrorTranslationFileTypeIdentityCard PassportElementErrorTranslationFileType = "identity_card"
PassportElementErrorTranslationFileTypeInternalPassport PassportElementErrorTranslationFileType = "internal_passport"
PassportElementErrorTranslationFileTypeUtilityBill PassportElementErrorTranslationFileType = "utility_bill"
PassportElementErrorTranslationFileTypeBankStatement PassportElementErrorTranslationFileType = "bank_statement"
PassportElementErrorTranslationFileTypeRentalAgreement PassportElementErrorTranslationFileType = "rental_agreement"
PassportElementErrorTranslationFileTypePassportRegistration PassportElementErrorTranslationFileType = "passport_registration"
PassportElementErrorTranslationFileTypeTemporaryRegistration PassportElementErrorTranslationFileType = "temporary_registration"
)
type PollType string
const (
PollTypeRegular PollType = "regular"
PollTypeQuiz PollType = "quiz"
)
type ReactionTypeCustomEmojiType string
const (
ReactionTypeCustomEmojiTypeCustomEmoji ReactionTypeCustomEmojiType = "custom_emoji"
)
type ReactionTypeEmojiType string
const (
ReactionTypeEmojiTypeEmoji ReactionTypeEmojiType = "emoji"
)
type ReactionTypePaidType string
const (
ReactionTypePaidTypePaid ReactionTypePaidType = "paid"
)
type RefundedPaymentCurrency string
const (
RefundedPaymentCurrencyXTR RefundedPaymentCurrency = "XTR"
)
type RevenueWithdrawalStateFailedType string
const (
RevenueWithdrawalStateFailedTypeFailed RevenueWithdrawalStateFailedType = "failed"
)
type RevenueWithdrawalStatePendingType string
const (
RevenueWithdrawalStatePendingTypePending RevenueWithdrawalStatePendingType = "pending"
)
type RevenueWithdrawalStateSucceededType string
const (
RevenueWithdrawalStateSucceededTypeSucceeded RevenueWithdrawalStateSucceededType = "succeeded"
)
type StickerType string
const (
StickerTypeRegular StickerType = "regular"
StickerTypeMask StickerType = "mask"
StickerTypeCustomEmoji StickerType = "custom_emoji"
)
type StoryAreaTypeLinkType string
const (
StoryAreaTypeLinkTypeLink StoryAreaTypeLinkType = "link"
)
type StoryAreaTypeLocationType string
const (
StoryAreaTypeLocationTypeLocation StoryAreaTypeLocationType = "location"
)
type StoryAreaTypeSuggestedReactionType string
const (
StoryAreaTypeSuggestedReactionTypeSuggestedReaction StoryAreaTypeSuggestedReactionType = "suggested_reaction"
)
type StoryAreaTypeUniqueGiftType string
const (
StoryAreaTypeUniqueGiftTypeUniqueGift StoryAreaTypeUniqueGiftType = "unique_gift"
)
type StoryAreaTypeWeatherType string
const (
StoryAreaTypeWeatherTypeWeather StoryAreaTypeWeatherType = "weather"
)
type SuggestedPostInfoState string
const (
SuggestedPostInfoStatePending SuggestedPostInfoState = "pending"
SuggestedPostInfoStateApproved SuggestedPostInfoState = "approved"
SuggestedPostInfoStateDeclined SuggestedPostInfoState = "declined"
)
type SuggestedPostPaidCurrency string
const (
SuggestedPostPaidCurrencyXTR SuggestedPostPaidCurrency = "XTR"
SuggestedPostPaidCurrencyTON SuggestedPostPaidCurrency = "TON"
)
type SuggestedPostRefundedReason string
const (
SuggestedPostRefundedReasonPostDeleted SuggestedPostRefundedReason = "post_deleted"
SuggestedPostRefundedReasonPaymentRefunded SuggestedPostRefundedReason = "payment_refunded"
)
type TransactionPartnerAffiliateProgramType string
const (
TransactionPartnerAffiliateProgramTypeAffiliateProgram TransactionPartnerAffiliateProgramType = "affiliate_program"
)
type TransactionPartnerFragmentType string
const (
TransactionPartnerFragmentTypeFragment TransactionPartnerFragmentType = "fragment"
)
type TransactionPartnerOtherType string
const (
TransactionPartnerOtherTypeOther TransactionPartnerOtherType = "other"
)
type TransactionPartnerTelegramAdsType string
const (
TransactionPartnerTelegramAdsTypeTelegramAds TransactionPartnerTelegramAdsType = "telegram_ads"
)
type TransactionPartnerTelegramApiType string
const (
TransactionPartnerTelegramApiTypeTelegramApi TransactionPartnerTelegramApiType = "telegram_api"
)
type TransactionPartnerUserTransactionType string
const (
TransactionPartnerUserTransactionTypeInvoicePayment TransactionPartnerUserTransactionType = "invoice_payment"
TransactionPartnerUserTransactionTypePaidMediaPayment TransactionPartnerUserTransactionType = "paid_media_payment"
TransactionPartnerUserTransactionTypeGiftPurchase TransactionPartnerUserTransactionType = "gift_purchase"
TransactionPartnerUserTransactionTypePremiumPurchase TransactionPartnerUserTransactionType = "premium_purchase"
TransactionPartnerUserTransactionTypeBusinessAccountTransfer TransactionPartnerUserTransactionType = "business_account_transfer"
)
type UniqueGiftInfoOrigin string
const (
UniqueGiftInfoOriginUpgrade UniqueGiftInfoOrigin = "upgrade"
UniqueGiftInfoOriginTransfer UniqueGiftInfoOrigin = "transfer"
UniqueGiftInfoOriginResale UniqueGiftInfoOrigin = "resale"
UniqueGiftInfoOriginGiftedUpgrade UniqueGiftInfoOrigin = "gifted_upgrade"
UniqueGiftInfoOriginOffer UniqueGiftInfoOrigin = "offer"
)
type UniqueGiftModelRarity string
const (
UniqueGiftModelRarityUncommon UniqueGiftModelRarity = "uncommon"
UniqueGiftModelRarityRare UniqueGiftModelRarity = "rare"
UniqueGiftModelRarityEpic UniqueGiftModelRarity = "epic"
UniqueGiftModelRarityLegendary UniqueGiftModelRarity = "legendary"
)
+34
View File
@@ -0,0 +1,34 @@
package api
// UpdateType identifies an Update payload variant. Used by allowed_updates
// in getUpdates / setWebhook. The Telegram docs do not enumerate these
// values inline (they are derived from the optional fields of Update),
// so the codegen pipeline cannot synthesise this enum and it lives here
// as a hand-curated companion to the generated enums.gen.go.
type UpdateType string
const (
UpdateMessage UpdateType = "message"
UpdateEditedMessage UpdateType = "edited_message"
UpdateChannelPost UpdateType = "channel_post"
UpdateEditedChannelPost UpdateType = "edited_channel_post"
UpdateBusinessConnection UpdateType = "business_connection"
UpdateBusinessMessage UpdateType = "business_message"
UpdateEditedBusinessMessage UpdateType = "edited_business_message"
UpdateDeletedBusinessMessages UpdateType = "deleted_business_messages"
UpdateMessageReaction UpdateType = "message_reaction"
UpdateMessageReactionCount UpdateType = "message_reaction_count"
UpdateInlineQuery UpdateType = "inline_query"
UpdateChosenInlineResult UpdateType = "chosen_inline_result"
UpdateCallbackQuery UpdateType = "callback_query"
UpdateShippingQuery UpdateType = "shipping_query"
UpdatePreCheckoutQuery UpdateType = "pre_checkout_query"
UpdatePurchasedPaidMedia UpdateType = "purchased_paid_media"
UpdatePoll UpdateType = "poll"
UpdatePollAnswer UpdateType = "poll_answer"
UpdateMyChatMember UpdateType = "my_chat_member"
UpdateChatMember UpdateType = "chat_member"
UpdateChatJoinRequest UpdateType = "chat_join_request"
UpdateChatBoost UpdateType = "chat_boost"
UpdateRemovedChatBoost UpdateType = "removed_chat_boost"
)
+32 -32
View File
@@ -198,7 +198,7 @@ type SendMessageParams struct {
// Text of the message to be sent, 1-4096 characters after entities parsing
Text string `json:"text"`
// Mode for parsing entities in the message text. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
// Link preview generation options for the message
@@ -305,7 +305,7 @@ type CopyMessageParams struct {
// New caption for media, 0-1024 characters after entities parsing. If not specified, the original caption is kept
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the new caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the new caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media. Ignored if a new caption isn't specified.
@@ -379,7 +379,7 @@ type SendPhotoParams struct {
// Photo caption (may also be used when resending photos by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the photo caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
@@ -427,7 +427,7 @@ func (p *SendPhotoParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -509,7 +509,7 @@ type SendLivePhotoParams struct {
// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the video caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
@@ -560,7 +560,7 @@ func (p *SendLivePhotoParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -648,7 +648,7 @@ type SendAudioParams struct {
// Audio caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the audio caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Duration of the audio in seconds
@@ -703,7 +703,7 @@ func (p *SendAudioParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -796,7 +796,7 @@ type SendDocumentParams struct {
// Document caption (may also be used when resending documents by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the document caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Disables automatic server-side content type detection for files uploaded using multipart/form-data
@@ -845,7 +845,7 @@ func (p *SendDocumentParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -941,7 +941,7 @@ type SendVideoParams struct {
// Video caption (may also be used when resending videos by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the video caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
@@ -1009,7 +1009,7 @@ func (p *SendVideoParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -1114,7 +1114,7 @@ type SendAnimationParams struct {
// Animation caption (may also be used when resending animation by file_id), 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the animation caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
@@ -1174,7 +1174,7 @@ func (p *SendAnimationParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -1261,7 +1261,7 @@ type SendVoiceParams struct {
// Voice message caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the voice message caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Duration of the voice message in seconds
@@ -1307,7 +1307,7 @@ func (p *SendVoiceParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -1511,7 +1511,7 @@ type SendPaidMediaParams struct {
// Media caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the media caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media
@@ -1559,7 +1559,7 @@ func (p *SendPaidMediaParams) MultipartFields() map[string]string {
out["caption"] = p.Caption
}
if p.ParseMode != "" {
out["parse_mode"] = p.ParseMode
out["parse_mode"] = string(p.ParseMode)
}
if p.CaptionEntities != nil {
if b, _ := json.Marshal(p.CaptionEntities); len(b) > 0 {
@@ -1843,7 +1843,7 @@ type SendPollParams struct {
// Poll question, 1-300 characters
Question string `json:"question"`
// Mode for parsing entities in the question. See formatting options for more details. Currently, only custom emoji entities are allowed
QuestionParseMode string `json:"question_parse_mode,omitempty"`
QuestionParseMode ParseMode `json:"question_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the poll question. It can be specified instead of question_parse_mode
QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
// A JSON-serialized list of 1-12 answer options
@@ -1871,7 +1871,7 @@ type SendPollParams struct {
// 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 with at most 2 line feeds after entities parsing
Explanation string `json:"explanation,omitempty"`
// Mode for parsing entities in the explanation. See formatting options for more details.
ExplanationParseMode string `json:"explanation_parse_mode,omitempty"`
ExplanationParseMode ParseMode `json:"explanation_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the poll explanation. It can be specified instead of explanation_parse_mode
ExplanationEntities []MessageEntity `json:"explanation_entities,omitempty"`
// Media added to the quiz explanation
@@ -1885,7 +1885,7 @@ type SendPollParams struct {
// Description of the poll to be sent, 0-1024 characters after entities parsing
Description string `json:"description,omitempty"`
// Mode for parsing entities in the poll description. See formatting options for more details.
DescriptionParseMode string `json:"description_parse_mode,omitempty"`
DescriptionParseMode ParseMode `json:"description_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the poll description, which can be specified instead of description_parse_mode
DescriptionEntities []MessageEntity `json:"description_entities,omitempty"`
// Media added to the poll description
@@ -1990,7 +1990,7 @@ type SendMessageDraftParams struct {
// Text of the message to be sent, 0-4096 characters after entities parsing. Pass an empty text to show a “Thinking…” placeholder.
Text string `json:"text,omitempty"`
// Mode for parsing entities in the message text. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
}
@@ -3390,7 +3390,7 @@ type SendGiftParams struct {
// Text that will be shown along with the gift; 0-128 characters
Text string `json:"text,omitempty"`
// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
TextParseMode string `json:"text_parse_mode,omitempty"`
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
TextEntities []MessageEntity `json:"text_entities,omitempty"`
}
@@ -3415,7 +3415,7 @@ type GiftPremiumSubscriptionParams struct {
// Text that will be shown along with the service message about the subscription; 0-128 characters
Text string `json:"text,omitempty"`
// Mode for parsing entities in the text. See formatting options for more details. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
TextParseMode string `json:"text_parse_mode,omitempty"`
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the gift text. It can be specified instead of text_parse_mode. Entities other than “bold”, “italic”, “underline”, “strikethrough”, “spoiler”, “custom_emoji”, and “date_time” are ignored.
TextEntities []MessageEntity `json:"text_entities,omitempty"`
}
@@ -3840,7 +3840,7 @@ type PostStoryParams struct {
// Caption of the story, 0-2048 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the story caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// A JSON-serialized list of clickable areas to be shown on the story
@@ -3896,7 +3896,7 @@ type EditStoryParams struct {
// Caption of the story, 0-2048 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the story caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// A JSON-serialized list of clickable areas to be shown on the story
@@ -4001,7 +4001,7 @@ type EditMessageTextParams struct {
// New text of the message, 1-4096 characters after entities parsing
Text string `json:"text"`
// Mode for parsing entities in the message text. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
// Link preview generation options for the message
@@ -4032,7 +4032,7 @@ type EditMessageCaptionParams struct {
// New caption of the message, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Mode for parsing entities in the message caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// A JSON-serialized list of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Pass True, if the caption must be shown above the message media. Supported only for animation, photo and video messages.
@@ -4492,7 +4492,7 @@ type UploadStickerFileParams struct {
// A file with the sticker in .WEBP, .PNG, .TGS, or .WEBM format. See https://core.telegram.org/stickers for technical requirements. More information on Sending Files »
Sticker *InputFile `json:"sticker"`
// Format of the sticker, must be one of “static”, “animated”, “video”
StickerFormat string `json:"sticker_format"`
StickerFormat InputStickerFormat `json:"sticker_format"`
}
// HasFile reports whether a multipart upload is required.
@@ -4507,7 +4507,7 @@ func (p *UploadStickerFileParams) HasFile() bool {
func (p *UploadStickerFileParams) MultipartFields() map[string]string {
out := map[string]string{}
out["user_id"] = strconv.FormatInt(p.UserID, 10)
out["sticker_format"] = p.StickerFormat
out["sticker_format"] = string(p.StickerFormat)
return out
}
@@ -4707,7 +4707,7 @@ type SetStickerSetThumbnailParams struct {
// A .WEBP or .PNG image with the thumbnail, must be up to 128 kilobytes in size and have a width and height of exactly 100px, or a .TGS animation with a thumbnail up to 32 kilobytes in size (see https://core.telegram.org/stickers#animation-requirements for animated sticker technical requirements), or a .WEBM video with the thumbnail up to 32 kilobytes in size; see https://core.telegram.org/stickers#video-requirements for video sticker technical requirements. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or upload a new one using multipart/form-data. More information on Sending Files ». Animated and video sticker set thumbnails can't be uploaded via HTTP URL. If omitted, then the thumbnail is dropped and the first sticker is used as the thumbnail.
Thumbnail *InputFile `json:"thumbnail,omitempty"`
// Format of the thumbnail, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, or “video” for a .WEBM video
Format string `json:"format"`
Format InputStickerFormat `json:"format"`
}
// HasFile reports whether a multipart upload is required.
@@ -4723,7 +4723,7 @@ func (p *SetStickerSetThumbnailParams) MultipartFields() map[string]string {
out := map[string]string{}
out["name"] = p.Name
out["user_id"] = strconv.FormatInt(p.UserID, 10)
out["format"] = p.Format
out["format"] = string(p.Format)
return out
}
+14 -14
View File
@@ -20954,7 +20954,7 @@ func Test_UploadStickerFile_Success(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(context.Background(), bot, params)
require.NoError(t, err)
@@ -20969,7 +20969,7 @@ func Test_UploadStickerFile_APIError(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(context.Background(), bot, params)
require.Error(t, err)
@@ -20987,7 +20987,7 @@ func Test_UploadStickerFile_NetworkError(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(context.Background(), bot, params)
require.Error(t, err)
@@ -21003,7 +21003,7 @@ func Test_UploadStickerFile_ParseError(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(context.Background(), bot, params)
require.Error(t, err)
@@ -21022,7 +21022,7 @@ func Test_UploadStickerFile_ContextCanceled(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(ctx, bot, params)
require.Error(t, err)
@@ -21063,7 +21063,7 @@ func Test_UploadStickerFile_Forbidden(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(context.Background(), bot, params)
require.Error(t, err)
@@ -21085,7 +21085,7 @@ func Test_UploadStickerFile_ServerError(t *testing.T) {
params := &UploadStickerFileParams{
UserID: 42,
Sticker: &InputFile{PathOrID: "file_id_test"},
StickerFormat: "test_value",
StickerFormat: InputStickerFormatStatic,
}
_, err := UploadStickerFile(context.Background(), bot, params)
require.Error(t, err)
@@ -22415,7 +22415,7 @@ func Test_SetStickerSetThumbnail_Success(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(context.Background(), bot, params)
require.NoError(t, err)
@@ -22430,7 +22430,7 @@ func Test_SetStickerSetThumbnail_APIError(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(context.Background(), bot, params)
require.Error(t, err)
@@ -22448,7 +22448,7 @@ func Test_SetStickerSetThumbnail_NetworkError(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(context.Background(), bot, params)
require.Error(t, err)
@@ -22464,7 +22464,7 @@ func Test_SetStickerSetThumbnail_ParseError(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(context.Background(), bot, params)
require.Error(t, err)
@@ -22483,7 +22483,7 @@ func Test_SetStickerSetThumbnail_ContextCanceled(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(ctx, bot, params)
require.Error(t, err)
@@ -22524,7 +22524,7 @@ func Test_SetStickerSetThumbnail_Forbidden(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(context.Background(), bot, params)
require.Error(t, err)
@@ -22546,7 +22546,7 @@ func Test_SetStickerSetThumbnail_ServerError(t *testing.T) {
params := &SetStickerSetThumbnailParams{
Name: "test_value",
UserID: 42,
Format: "test_value",
Format: InputStickerFormatStatic,
}
_, err := SetStickerSetThumbnail(context.Background(), bot, params)
require.Error(t, err)
+101 -101
View File
@@ -137,7 +137,7 @@ type Chat struct {
// Unique identifier for this chat. 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 signed 64-bit integer or double-precision float type are safe for storing this identifier.
ID int64 `json:"id"`
// Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Type string `json:"type"`
Type ChatType `json:"type"`
// Optional. Title, for supergroups, channels and group chats
Title string `json:"title,omitempty"`
// Optional. Username, for private chats, supergroups and channels if available
@@ -157,7 +157,7 @@ type ChatFullInfo struct {
// Unique identifier for this chat. 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 signed 64-bit integer or double-precision float type are safe for storing this identifier.
ID int64 `json:"id"`
// Type of the chat, can be either “private”, “group”, “supergroup” or “channel”
Type string `json:"type"`
Type ChatType `json:"type"`
// Optional. Title, for supergroups, channels and group chats
Title string `json:"title,omitempty"`
// Optional. Username, for private chats, supergroups and channels if available
@@ -614,7 +614,7 @@ func UnmarshalMaybeInaccessibleMessage(data []byte) (MaybeInaccessibleMessage, e
// This object represents one special entity in a text message. For example, hashtags, usernames, URLs, etc.
type MessageEntity struct {
// Type of the entity. Currently, can be “mention” (@username), “hashtag” (#hashtag or #hashtag@chatusername), “cashtag” ($USD or $USD@chatusername), “bot_command” (/start@jobs_bot), “url” (https://telegram.org), “email” (do-not-reply@telegram.org), “phone_number” (+1-212-555-0123), “bold” (bold text), “italic” (italic text), “underline” (underlined text), “strikethrough” (strikethrough text), “spoiler” (spoiler message), “blockquote” (block quotation), “expandable_blockquote” (collapsed-by-default block quotation), “code” (monowidth string), “pre” (monowidth block), “text_link” (for clickable text URLs), “text_mention” (for users without usernames), “custom_emoji” (for inline custom emoji stickers), or “date_time” (for formatted date and time)
Type string `json:"type"`
Type MessageEntityType `json:"type"`
// Offset in UTF-16 code units to the start of the entity
Offset int64 `json:"offset"`
// Length of the entity in UTF-16 code units
@@ -736,7 +736,7 @@ type ReplyParameters struct {
// Optional. Quoted part of the message to be replied to; 0-1024 characters after entities parsing. The quote must be an exact substring of the message to be replied to, including bold, italic, underline, strikethrough, spoiler, custom_emoji, and date_time entities. The message will fail to send if the quote isn't found in the original message.
Quote string `json:"quote,omitempty"`
// Optional. Mode for parsing entities in the quote. See formatting options for more details.
QuoteParseMode string `json:"quote_parse_mode,omitempty"`
QuoteParseMode ParseMode `json:"quote_parse_mode,omitempty"`
// Optional. A JSON-serialized list of special entities that appear in the quote. It can be specified instead of quote_parse_mode.
QuoteEntities []MessageEntity `json:"quote_entities,omitempty"`
// Optional. Position of the quote in the original message in UTF-16 code units
@@ -800,7 +800,7 @@ func UnmarshalMessageOrigin(data []byte) (MessageOrigin, error) {
// The message was originally sent by a known user.
type MessageOriginUser struct {
// Type of the message origin, always “user”
Type string `json:"type"`
Type MessageOriginUserType `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// User that sent the message originally
@@ -810,7 +810,7 @@ type MessageOriginUser struct {
// The message was originally sent by an unknown user.
type MessageOriginHiddenUser struct {
// Type of the message origin, always “hidden_user”
Type string `json:"type"`
Type MessageOriginHiddenUserType `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// Name of the user that sent the message originally
@@ -820,7 +820,7 @@ type MessageOriginHiddenUser struct {
// The message was originally sent on behalf of a chat to a group chat.
type MessageOriginChat struct {
// Type of the message origin, always “chat”
Type string `json:"type"`
Type MessageOriginChatType `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// Chat that sent the message originally
@@ -832,7 +832,7 @@ type MessageOriginChat struct {
// The message was originally sent to a channel chat.
type MessageOriginChannel struct {
// Type of the message origin, always “channel”
Type string `json:"type"`
Type MessageOriginChannelType `json:"type"`
// Date the message was sent originally in Unix time
Date int64 `json:"date"`
// Channel chat to which the message was originally sent
@@ -1110,7 +1110,7 @@ func UnmarshalPaidMedia(data []byte) (PaidMedia, error) {
// The paid media is a live photo.
type PaidMediaLivePhoto struct {
// Type of the paid media, always “live_photo”
Type string `json:"type"`
Type PaidMediaLivePhotoType `json:"type"`
// The photo
LivePhoto LivePhoto `json:"live_photo"`
}
@@ -1118,7 +1118,7 @@ type PaidMediaLivePhoto struct {
// The paid media is a photo.
type PaidMediaPhoto struct {
// Type of the paid media, always “photo”
Type string `json:"type"`
Type PaidMediaPhotoType `json:"type"`
// The photo
Photo []PhotoSize `json:"photo"`
}
@@ -1126,7 +1126,7 @@ type PaidMediaPhoto struct {
// The paid media isn't available before the payment.
type PaidMediaPreview struct {
// Type of the paid media, always “preview”
Type string `json:"type"`
Type PaidMediaPreviewType `json:"type"`
// Optional. Media width as defined by the sender
Width *int64 `json:"width,omitempty"`
// Optional. Media height as defined by the sender
@@ -1138,7 +1138,7 @@ type PaidMediaPreview struct {
// The paid media is a video.
type PaidMediaVideo struct {
// Type of the paid media, always “video”
Type string `json:"type"`
Type PaidMediaVideoType `json:"type"`
// The video
Video Video `json:"video"`
}
@@ -1284,7 +1284,7 @@ type InputPollOption struct {
// Option text, 1-100 characters
Text string `json:"text"`
// Optional. Mode for parsing entities in the text. See formatting options for more details. Currently, only custom emoji entities are allowed
TextParseMode string `json:"text_parse_mode,omitempty"`
TextParseMode ParseMode `json:"text_parse_mode,omitempty"`
// 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"`
// Optional. Media added to the poll option
@@ -1322,7 +1322,7 @@ type Poll struct {
// True, if the poll is anonymous
IsAnonymous bool `json:"is_anonymous"`
// Poll type, currently can be “regular” or “quiz”
Type string `json:"type"`
Type PollType `json:"type"`
// True, if the poll allows multiple answers
AllowsMultipleAnswers bool `json:"allows_multiple_answers"`
// True, if the poll allows to change the chosen answer options
@@ -1388,7 +1388,7 @@ type InputChecklistTask struct {
// Text of the task; 1-100 characters after entities parsing
Text string `json:"text"`
// Optional. Mode for parsing entities in the text. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// 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"`
}
@@ -1398,7 +1398,7 @@ type InputChecklist struct {
// Title of the checklist; 1-255 characters after entities parsing
Title string `json:"title"`
// Optional. Mode for parsing entities in the title. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// 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"`
// List of 1-30 tasks in the checklist
@@ -1624,7 +1624,7 @@ func UnmarshalBackgroundFill(data []byte) (BackgroundFill, error) {
// The background is filled using the selected color.
type BackgroundFillSolid struct {
// Type of the background fill, always “solid”
Type string `json:"type"`
Type BackgroundFillSolidType `json:"type"`
// The color of the background fill in the RGB24 format
Color int64 `json:"color"`
}
@@ -1632,7 +1632,7 @@ type BackgroundFillSolid struct {
// The background is a gradient fill.
type BackgroundFillGradient struct {
// Type of the background fill, always “gradient”
Type string `json:"type"`
Type BackgroundFillGradientType `json:"type"`
// Top color of the gradient in the RGB24 format
TopColor int64 `json:"top_color"`
// Bottom color of the gradient in the RGB24 format
@@ -1644,7 +1644,7 @@ type BackgroundFillGradient struct {
// The background is a freeform gradient that rotates after every message in the chat.
type BackgroundFillFreeformGradient struct {
// Type of the background fill, always “freeform_gradient”
Type string `json:"type"`
Type BackgroundFillFreeformGradientType `json:"type"`
// A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format
Colors []int64 `json:"colors"`
}
@@ -1702,7 +1702,7 @@ func UnmarshalBackgroundType(data []byte) (BackgroundType, error) {
// The background is automatically filled based on the selected colors.
type BackgroundTypeFill struct {
// Type of the background, always “fill”
Type string `json:"type"`
Type BackgroundTypeFillType `json:"type"`
// The background fill
Fill BackgroundFill `json:"fill"`
// Dimming of the background in dark themes, as a percentage; 0-100
@@ -1736,7 +1736,7 @@ func (m *BackgroundTypeFill) UnmarshalJSON(data []byte) error {
// The background is a wallpaper in the JPEG format.
type BackgroundTypeWallpaper struct {
// Type of the background, always “wallpaper”
Type string `json:"type"`
Type BackgroundTypeWallpaperType `json:"type"`
// Document with the wallpaper
Document Document `json:"document"`
// Dimming of the background in dark themes, as a percentage; 0-100
@@ -1750,7 +1750,7 @@ type BackgroundTypeWallpaper struct {
// The background is a .PNG or .TGV (gzipped subset of SVG with MIME type “application/x-tgwallpattern”) pattern to be combined with the background fill chosen by the user.
type BackgroundTypePattern struct {
// Type of the background, always “pattern”
Type string `json:"type"`
Type BackgroundTypePatternType `json:"type"`
// Document with the pattern
Document Document `json:"document"`
// The background fill that is combined with the pattern
@@ -1790,7 +1790,7 @@ func (m *BackgroundTypePattern) UnmarshalJSON(data []byte) error {
// The background is taken directly from a built-in chat theme.
type BackgroundTypeChatTheme struct {
// Type of the background, always “chat_theme”
Type string `json:"type"`
Type BackgroundTypeChatThemeType `json:"type"`
// Name of the chat theme, which is usually an emoji
ThemeName string `json:"theme_name"`
}
@@ -1974,7 +1974,7 @@ type SuggestedPostPaid struct {
// Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Currency in which the payment was made. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins
Currency string `json:"currency"`
Currency SuggestedPostPaidCurrency `json:"currency"`
// Optional. The amount of the currency that was received by the channel in nanotoncoins; for payments in toncoins only
Amount *int64 `json:"amount,omitempty"`
// Optional. The amount of Telegram Stars that was received by the channel; for payments in Telegram Stars only
@@ -1986,7 +1986,7 @@ type SuggestedPostRefunded struct {
// Optional. Message containing the suggested post. Note that the Message object in this field will not contain the reply_to_message field even if it itself is a reply.
SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"`
// Reason for the refund. Currently, one of “post_deleted” if the post was deleted within 24 hours of being posted or removed from scheduled messages without being posted, or “payment_refunded” if the payer refunded their payment.
Reason string `json:"reason"`
Reason SuggestedPostRefundedReason `json:"reason"`
}
// This object represents a service message about the creation of a scheduled giveaway.
@@ -2074,7 +2074,7 @@ type LinkPreviewOptions struct {
// Describes the price of a suggested post.
type SuggestedPostPrice struct {
// Currency in which the post will be paid. Currently, must be one of “XTR” for Telegram Stars or “TON” for toncoins
Currency string `json:"currency"`
Currency SuggestedPostPaidCurrency `json:"currency"`
// The amount of the currency that will be paid for the post in the smallest units of the currency, i.e. Telegram Stars or nanotoncoins. Currently, price in Telegram Stars must be between 5 and 100000, and price in nanotoncoins must be between 10000000 and 10000000000000.
Amount int64 `json:"amount"`
}
@@ -2082,7 +2082,7 @@ type SuggestedPostPrice struct {
// Contains information about a suggested post.
type SuggestedPostInfo struct {
// State of the suggested post. Currently, it can be one of “pending”, “approved”, “declined”.
State string `json:"state"`
State SuggestedPostInfoState `json:"state"`
// Optional. Proposed price of the post. If the field is omitted, then the post is unpaid.
Price *SuggestedPostPrice `json:"price,omitempty"`
// Optional. Proposed send date of the post. If the field is omitted, then the post can be published at any time within 30 days at the sole discretion of the user or administrator who approves it.
@@ -2163,7 +2163,7 @@ type KeyboardButton struct {
// Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
// Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
Style string `json:"style,omitempty"`
Style KeyboardButtonStyle `json:"style,omitempty"`
// Optional. If specified, pressing the button will open a list of suitable users. Identifiers of selected users will be sent to the bot in a “users_shared” service message. Available in private chats only.
RequestUsers *KeyboardButtonRequestUsers `json:"request_users,omitempty"`
// Optional. If specified, pressing the button will open a list of suitable chats. Tapping on a chat will send its identifier to the bot in a “chat_shared” service message. Available in private chats only.
@@ -2261,7 +2261,7 @@ type InlineKeyboardButton struct {
// Optional. Unique identifier of the custom emoji shown before the text of the button. Can only be used by bots that purchased additional usernames on Fragment or in the messages directly sent by the bot to private, group and supergroup chats if the owner of the bot has a Telegram Premium subscription.
IconCustomEmojiID string `json:"icon_custom_emoji_id,omitempty"`
// Optional. Style of the button. Must be one of “danger” (red), “success” (green) or “primary” (blue). If omitted, then an app-specific style is used.
Style string `json:"style,omitempty"`
Style KeyboardButtonStyle `json:"style,omitempty"`
// Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their identifier without using a username, if this is allowed by their privacy settings.
URL string `json:"url,omitempty"`
// Optional. Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes
@@ -2568,7 +2568,7 @@ func UnmarshalChatMember(data []byte) (ChatMember, error) {
// Represents a chat member that owns the chat and has all administrator privileges.
type ChatMemberOwner struct {
// The member's status in the chat, always “creator”
Status string `json:"status"`
Status ChatMemberOwnerStatus `json:"status"`
// Information about the user
User User `json:"user"`
// True, if the user's presence in the chat is hidden
@@ -2580,7 +2580,7 @@ type ChatMemberOwner struct {
// Represents a chat member that has some additional privileges.
type ChatMemberAdministrator struct {
// The member's status in the chat, always “administrator”
Status string `json:"status"`
Status ChatMemberAdministratorStatus `json:"status"`
// Information about the user
User User `json:"user"`
// True, if the bot is allowed to edit administrator privileges of that user
@@ -2626,7 +2626,7 @@ type ChatMemberAdministrator struct {
// Represents a chat member that has no additional privileges or restrictions.
type ChatMemberMember struct {
// The member's status in the chat, always “member”
Status string `json:"status"`
Status ChatMemberMemberStatus `json:"status"`
// Optional. Tag of the member
Tag string `json:"tag,omitempty"`
// Information about the user
@@ -2638,7 +2638,7 @@ type ChatMemberMember struct {
// Represents a chat member that is under certain restrictions in the chat. Supergroups only.
type ChatMemberRestricted struct {
// The member's status in the chat, always “restricted”
Status string `json:"status"`
Status ChatMemberRestrictedStatus `json:"status"`
// Optional. Tag of the member
Tag string `json:"tag,omitempty"`
// Information about the user
@@ -2684,7 +2684,7 @@ type ChatMemberRestricted struct {
// Represents a chat member that isn't currently a member of the chat, but may join it themselves.
type ChatMemberLeft struct {
// The member's status in the chat, always “left”
Status string `json:"status"`
Status ChatMemberLeftStatus `json:"status"`
// Information about the user
User User `json:"user"`
}
@@ -2692,7 +2692,7 @@ type ChatMemberLeft struct {
// Represents a chat member that was banned in the chat and can't return to the chat or view chat messages.
type ChatMemberBanned struct {
// The member's status in the chat, always “kicked”
Status string `json:"status"`
Status ChatMemberBannedStatus `json:"status"`
// Information about the user
User User `json:"user"`
// Date when restrictions will be lifted for this user; Unix time. If 0, then the user is banned forever
@@ -2894,7 +2894,7 @@ func UnmarshalStoryAreaType(data []byte) (StoryAreaType, error) {
// Describes a story area pointing to a location. Currently, a story can have up to 10 location areas.
type StoryAreaTypeLocation struct {
// Type of the area, always “location”
Type string `json:"type"`
Type StoryAreaTypeLocationType `json:"type"`
// Location latitude in degrees
Latitude float64 `json:"latitude"`
// Location longitude in degrees
@@ -2906,7 +2906,7 @@ type StoryAreaTypeLocation struct {
// Describes a story area pointing to a suggested reaction. Currently, a story can have up to 5 suggested reaction areas.
type StoryAreaTypeSuggestedReaction struct {
// Type of the area, always “suggested_reaction”
Type string `json:"type"`
Type StoryAreaTypeSuggestedReactionType `json:"type"`
// Type of the reaction
ReactionType ReactionType `json:"reaction_type"`
// Optional. Pass True if the reaction area has a dark background
@@ -2942,7 +2942,7 @@ func (m *StoryAreaTypeSuggestedReaction) UnmarshalJSON(data []byte) error {
// Describes a story area pointing to an HTTP or tg:// link. Currently, a story can have up to 3 link areas.
type StoryAreaTypeLink struct {
// Type of the area, always “link”
Type string `json:"type"`
Type StoryAreaTypeLinkType `json:"type"`
// HTTP or tg:// URL to be opened when the area is clicked
URL string `json:"url"`
}
@@ -2950,7 +2950,7 @@ type StoryAreaTypeLink struct {
// Describes a story area containing weather information. Currently, a story can have up to 3 weather areas.
type StoryAreaTypeWeather struct {
// Type of the area, always “weather”
Type string `json:"type"`
Type StoryAreaTypeWeatherType `json:"type"`
// Temperature, in degree Celsius
Temperature float64 `json:"temperature"`
// Emoji representing the weather
@@ -2962,7 +2962,7 @@ type StoryAreaTypeWeather struct {
// Describes a story area pointing to a unique gift. Currently, a story can have at most 1 unique gift area.
type StoryAreaTypeUniqueGift struct {
// Type of the area, always “unique_gift”
Type string `json:"type"`
Type StoryAreaTypeUniqueGiftType `json:"type"`
// Unique name of the gift
Name string `json:"name"`
}
@@ -3054,7 +3054,7 @@ func UnmarshalReactionType(data []byte) (ReactionType, error) {
// The reaction is based on an emoji.
type ReactionTypeEmoji struct {
// Type of the reaction, always “emoji”
Type string `json:"type"`
Type ReactionTypeEmojiType `json:"type"`
// Reaction emoji. Currently, it can be one of "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "", ""
Emoji string `json:"emoji"`
}
@@ -3062,7 +3062,7 @@ type ReactionTypeEmoji struct {
// The reaction is based on a custom emoji.
type ReactionTypeCustomEmoji struct {
// Type of the reaction, always “custom_emoji”
Type string `json:"type"`
Type ReactionTypeCustomEmojiType `json:"type"`
// Custom emoji identifier
CustomEmojiID string `json:"custom_emoji_id"`
}
@@ -3070,7 +3070,7 @@ type ReactionTypeCustomEmoji struct {
// The reaction is paid.
type ReactionTypePaid struct {
// Type of the reaction, always “paid”
Type string `json:"type"`
Type ReactionTypePaidType `json:"type"`
}
// Represents a reaction added to a message along with the number of times it was added.
@@ -3254,7 +3254,7 @@ type UniqueGiftModel struct {
// The number of unique gifts that receive this model for every 1000 gift upgrades. Always 0 for crafted gifts.
RarityPerMille int64 `json:"rarity_per_mille"`
// Optional. Rarity of the model if it is a crafted model. Currently, can be “uncommon”, “rare”, “epic”, or “legendary”.
Rarity string `json:"rarity,omitempty"`
Rarity UniqueGiftModelRarity `json:"rarity,omitempty"`
}
// This object describes the symbol shown on the pattern of a unique gift.
@@ -3362,9 +3362,9 @@ type UniqueGiftInfo struct {
// Information about the gift
Gift UniqueGift `json:"gift"`
// Origin of the gift. Currently, either “upgrade” for gifts upgraded from regular gifts, “transfer” for gifts transferred from other users or channels, “resale” for gifts bought from other users, “gifted_upgrade” for upgrades purchased after the gift was sent, or “offer” for gifts bought or sold through gift purchase offers
Origin string `json:"origin"`
Origin UniqueGiftInfoOrigin `json:"origin"`
// Optional. For gifts bought from other users, the currency in which the payment for the gift was done. Currently, one of “XTR” for Telegram Stars or “TON” for toncoins.
LastResaleCurrency string `json:"last_resale_currency,omitempty"`
LastResaleCurrency SuggestedPostPaidCurrency `json:"last_resale_currency,omitempty"`
// Optional. For gifts bought from other users, the price paid for the gift in either Telegram Stars or nanotoncoins
LastResaleAmount *int64 `json:"last_resale_amount,omitempty"`
// Optional. Unique identifier of the received gift for the bot; only present for gifts received on behalf of business accounts
@@ -3416,7 +3416,7 @@ func UnmarshalOwnedGift(data []byte) (OwnedGift, error) {
// Describes a regular gift owned by a user or a chat.
type OwnedGiftRegular struct {
// Type of the gift, always “regular”
Type string `json:"type"`
Type OwnedGiftRegularType `json:"type"`
// Information about the regular gift
Gift Gift `json:"gift"`
// Optional. Unique identifier of the gift for the bot; for gifts received on behalf of business accounts only
@@ -3450,7 +3450,7 @@ type OwnedGiftRegular struct {
// Describes a unique gift received and owned by a user or a chat.
type OwnedGiftUnique struct {
// Type of the gift, always “unique”
Type string `json:"type"`
Type OwnedGiftUniqueType `json:"type"`
// Information about the unique gift
Gift UniqueGift `json:"gift"`
// Optional. Unique identifier of the received gift for the bot; for gifts received on behalf of business accounts only
@@ -3765,7 +3765,7 @@ func UnmarshalChatBoostSource(data []byte) (ChatBoostSource, error) {
// The boost was obtained by subscribing to Telegram Premium or by gifting a Telegram Premium subscription to another user.
type ChatBoostSourcePremium struct {
// Source of the boost, always “premium”
Source string `json:"source"`
Source ChatBoostSourcePremiumSource `json:"source"`
// User that boosted the chat
User User `json:"user"`
}
@@ -3773,7 +3773,7 @@ type ChatBoostSourcePremium struct {
// The boost was obtained by the creation of Telegram Premium gift codes to boost a chat. Each such code boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription.
type ChatBoostSourceGiftCode struct {
// Source of the boost, always “gift_code”
Source string `json:"source"`
Source ChatBoostSourceGiftCodeSource `json:"source"`
// User for which the gift code was created
User User `json:"user"`
}
@@ -3781,7 +3781,7 @@ type ChatBoostSourceGiftCode struct {
// The boost was obtained by the creation of a Telegram Premium or a Telegram Star giveaway. This boosts the chat 4 times for the duration of the corresponding Telegram Premium subscription for Telegram Premium giveaways and prize_star_count / 500 times for one year for Telegram Star giveaways.
type ChatBoostSourceGiveaway struct {
// Source of the boost, always “giveaway”
Source string `json:"source"`
Source ChatBoostSourceGiveawaySource `json:"source"`
// Identifier of a message in the chat with the giveaway; the message could have been deleted already. May be 0 if the message isn't sent yet.
GiveawayMessageID int64 `json:"giveaway_message_id"`
// Optional. User that won the prize in the giveaway if any; for Telegram Premium giveaways only
@@ -4015,7 +4015,7 @@ type InputMediaAnimation struct {
// Optional. Caption of the animation to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the animation caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4041,7 +4041,7 @@ type InputMediaAudio struct {
// Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Duration of the audio in seconds
@@ -4063,7 +4063,7 @@ type InputMediaDocument struct {
// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the document caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Disables automatic server-side content type detection for files uploaded using multipart/form-data. Always True, if the document is sent as part of an album.
@@ -4081,7 +4081,7 @@ type InputMediaLivePhoto struct {
// Optional. Caption of the live photo to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the live photo caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4111,7 +4111,7 @@ type InputMediaPhoto struct {
// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4167,7 +4167,7 @@ type InputMediaVideo struct {
// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the video caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4317,7 +4317,7 @@ type Sticker struct {
// 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"`
// Type of the sticker, currently one of “regular”, “mask”, “custom_emoji”. The type of the sticker is independent from its format, which is determined by the fields is_animated and is_video.
Type string `json:"type"`
Type StickerType `json:"type"`
// Sticker width
Width int64 `json:"width"`
// Sticker height
@@ -4351,7 +4351,7 @@ type StickerSet struct {
// Sticker set title
Title string `json:"title"`
// Type of stickers in the set, currently one of “regular”, “mask”, “custom_emoji”
StickerType string `json:"sticker_type"`
StickerType StickerType `json:"sticker_type"`
// List of all set stickers
Stickers []Sticker `json:"stickers"`
// Optional. Sticker set thumbnail in the .WEBP, .TGS, or .WEBM format
@@ -4361,7 +4361,7 @@ type StickerSet struct {
// This object describes the position on faces where a mask should be placed by default.
type MaskPosition struct {
// The part of the face relative to which the mask should be placed. One of “forehead”, “eyes”, “mouth”, or “chin”.
Point string `json:"point"`
Point MaskPositionPoint `json:"point"`
// Shift by X-axis measured in widths of the mask scaled to the face size, from left to right. For example, choosing -1.0 will place mask just to the left of the default mask position.
XShift float64 `json:"x_shift"`
// Shift by Y-axis measured in heights of the mask scaled to the face size, from top to bottom. For example, 1.0 will place the mask just below the default mask position.
@@ -4375,7 +4375,7 @@ type InputSticker struct {
// The added sticker. Pass a file_id as a String to send a file that already exists on the Telegram servers, pass an HTTP URL as a String for Telegram to get a file from the Internet, or pass “attach://<file_attach_name>” to upload a new file using multipart/form-data under <file_attach_name> name. Animated and video stickers can't be uploaded via HTTP URL. More information on Sending Files »
Sticker string `json:"sticker"`
// Format of the added sticker, must be one of “static” for a .WEBP or .PNG image, “animated” for a .TGS animation, “video” for a .WEBM video
Format string `json:"format"`
Format InputStickerFormat `json:"format"`
// List of 1-20 emoji associated with the sticker
EmojiList []string `json:"emoji_list"`
// Optional. Position where the mask should be placed on faces. For “mask” stickers only.
@@ -4395,7 +4395,7 @@ type InlineQuery struct {
// Offset of the results to be returned, can be controlled by the bot
Offset string `json:"offset"`
// Optional. 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"`
ChatType InlineQueryChatType `json:"chat_type,omitempty"`
// Optional. Sender location, only for bots that request user location
Location *Location `json:"location,omitempty"`
}
@@ -4542,7 +4542,7 @@ type InlineQueryResultPhoto struct {
// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4570,13 +4570,13 @@ type InlineQueryResultGif struct {
// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
ThumbnailURL string `json:"thumbnail_url"`
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
ThumbnailMimeType string `json:"thumbnail_mime_type,omitempty"`
ThumbnailMimeType InlineQueryResultGifThumbnailMimeType `json:"thumbnail_mime_type,omitempty"`
// Optional. Title for the result
Title string `json:"title,omitempty"`
// Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4604,13 +4604,13 @@ type InlineQueryResultMpeg4Gif struct {
// URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result
ThumbnailURL string `json:"thumbnail_url"`
// Optional. MIME type of the thumbnail, must be one of “image/jpeg”, “image/gif”, or “video/mp4”. Defaults to “image/jpeg”
ThumbnailMimeType string `json:"thumbnail_mime_type,omitempty"`
ThumbnailMimeType InlineQueryResultGifThumbnailMimeType `json:"thumbnail_mime_type,omitempty"`
// Optional. Title for the result
Title string `json:"title,omitempty"`
// Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4639,7 +4639,7 @@ type InlineQueryResultVideo struct {
// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the video caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4671,7 +4671,7 @@ type InlineQueryResultAudio struct {
// Optional. Caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Performer
@@ -4697,7 +4697,7 @@ type InlineQueryResultVoice struct {
// Optional. Caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Recording duration in seconds
@@ -4719,13 +4719,13 @@ type InlineQueryResultDocument struct {
// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the document caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// A valid URL for the file
DocumentURL string `json:"document_url"`
// MIME type of the content of the file, either “application/pdf” or “application/zip”
MimeType string `json:"mime_type"`
MimeType InlineQueryResultDocumentMimeType `json:"mime_type"`
// Optional. Short description of the result
Description string `json:"description,omitempty"`
// Optional. Inline keyboard attached to the message
@@ -4859,7 +4859,7 @@ type InlineQueryResultCachedPhoto struct {
// Optional. Caption of the photo to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the photo caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4883,7 +4883,7 @@ type InlineQueryResultCachedGif struct {
// Optional. Caption of the GIF file to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4907,7 +4907,7 @@ type InlineQueryResultCachedMpeg4Gif struct {
// Optional. Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4947,7 +4947,7 @@ type InlineQueryResultCachedDocument struct {
// Optional. Caption of the document to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the document caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Inline keyboard attached to the message
@@ -4971,7 +4971,7 @@ type InlineQueryResultCachedVideo struct {
// Optional. Caption of the video to be sent, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the video caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Pass True, if the caption must be shown above the message media
@@ -4995,7 +4995,7 @@ type InlineQueryResultCachedVoice struct {
// Optional. Caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the voice message caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Inline keyboard attached to the message
@@ -5015,7 +5015,7 @@ type InlineQueryResultCachedAudio struct {
// Optional. Caption, 0-1024 characters after entities parsing
Caption string `json:"caption,omitempty"`
// Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
// Optional. Inline keyboard attached to the message
@@ -5055,7 +5055,7 @@ type InputTextMessageContent struct {
// Text of the message to be sent, 1-4096 characters
MessageText string `json:"message_text"`
// Optional. Mode for parsing entities in the message text. See formatting options for more details.
ParseMode string `json:"parse_mode,omitempty"`
ParseMode ParseMode `json:"parse_mode,omitempty"`
// Optional. List of special entities that appear in message text, which can be specified instead of parse_mode
Entities []MessageEntity `json:"entities,omitempty"`
// Optional. Link preview generation options for the message
@@ -5256,7 +5256,7 @@ type SuccessfulPayment struct {
// This object contains basic information about a refunded payment.
type RefundedPayment struct {
// Three-letter ISO 4217 currency code, or “XTR” for payments in Telegram Stars. Currently, always “XTR”
Currency string `json:"currency"`
Currency RefundedPaymentCurrency `json:"currency"`
// Total refunded price in the smallest units of the currency (integer, not float/double). For example, for a price of US$ 1.45, total_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).
TotalAmount int64 `json:"total_amount"`
// Bot-specified invoice payload
@@ -5352,13 +5352,13 @@ func UnmarshalRevenueWithdrawalState(data []byte) (RevenueWithdrawalState, error
// The withdrawal is in progress.
type RevenueWithdrawalStatePending struct {
// Type of the state, always “pending”
Type string `json:"type"`
Type RevenueWithdrawalStatePendingType `json:"type"`
}
// The withdrawal succeeded.
type RevenueWithdrawalStateSucceeded struct {
// Type of the state, always “succeeded”
Type string `json:"type"`
Type RevenueWithdrawalStateSucceededType `json:"type"`
// Date the withdrawal was completed in Unix time
Date int64 `json:"date"`
// An HTTPS URL that can be used to see transaction details
@@ -5368,7 +5368,7 @@ type RevenueWithdrawalStateSucceeded struct {
// The withdrawal failed and the transaction was refunded.
type RevenueWithdrawalStateFailed struct {
// Type of the state, always “failed”
Type string `json:"type"`
Type RevenueWithdrawalStateFailedType `json:"type"`
}
// Contains information about the affiliate that received a commission via this transaction.
@@ -5452,9 +5452,9 @@ func UnmarshalTransactionPartner(data []byte) (TransactionPartner, error) {
// Describes a transaction with a user.
type TransactionPartnerUser struct {
// Type of the transaction partner, always “user”
Type string `json:"type"`
Type MessageOriginUserType `json:"type"`
// Type of the transaction, currently one of “invoice_payment” for payments via invoices, “paid_media_payment” for payments for paid media, “gift_purchase” for gifts sent by the bot, “premium_purchase” for Telegram Premium subscriptions gifted by the bot, “business_account_transfer” for direct transfers from managed business accounts
TransactionType string `json:"transaction_type"`
TransactionType TransactionPartnerUserTransactionType `json:"transaction_type"`
// Information about the user
User User `json:"user"`
// Optional. Information about the affiliate that received a commission via this transaction. Can be available only for “invoice_payment” and “paid_media_payment” transactions.
@@ -5508,7 +5508,7 @@ func (m *TransactionPartnerUser) UnmarshalJSON(data []byte) error {
// Describes a transaction with a chat.
type TransactionPartnerChat struct {
// Type of the transaction partner, always “chat”
Type string `json:"type"`
Type MessageOriginChatType `json:"type"`
// Information about the chat
Chat Chat `json:"chat"`
// Optional. The gift sent to the chat by the bot
@@ -5518,7 +5518,7 @@ type TransactionPartnerChat struct {
// Describes the affiliate program that issued the affiliate commission received via this transaction.
type TransactionPartnerAffiliateProgram struct {
// Type of the transaction partner, always “affiliate_program”
Type string `json:"type"`
Type TransactionPartnerAffiliateProgramType `json:"type"`
// Optional. Information about the bot that sponsored the affiliate program
SponsorUser *User `json:"sponsor_user,omitempty"`
// The number of Telegram Stars received by the bot for each 1000 Telegram Stars received by the affiliate program sponsor from referred users
@@ -5528,7 +5528,7 @@ type TransactionPartnerAffiliateProgram struct {
// Describes a withdrawal transaction with Fragment.
type TransactionPartnerFragment struct {
// Type of the transaction partner, always “fragment”
Type string `json:"type"`
Type TransactionPartnerFragmentType `json:"type"`
// Optional. State of the transaction if the transaction is outgoing
WithdrawalState RevenueWithdrawalState `json:"withdrawal_state,omitempty"`
}
@@ -5560,13 +5560,13 @@ func (m *TransactionPartnerFragment) UnmarshalJSON(data []byte) error {
// Describes a withdrawal transaction to the Telegram Ads platform.
type TransactionPartnerTelegramAds struct {
// Type of the transaction partner, always “telegram_ads”
Type string `json:"type"`
Type TransactionPartnerTelegramAdsType `json:"type"`
}
// Describes a transaction with payment for paid broadcasting.
type TransactionPartnerTelegramApi struct {
// Type of the transaction partner, always “telegram_api”
Type string `json:"type"`
Type TransactionPartnerTelegramApiType `json:"type"`
// The number of successful requests that exceeded regular limits and were therefore billed
RequestCount int64 `json:"request_count"`
}
@@ -5574,7 +5574,7 @@ type TransactionPartnerTelegramApi struct {
// Describes a transaction with an unknown source or recipient.
type TransactionPartnerOther struct {
// Type of the transaction partner, always “other”
Type string `json:"type"`
Type TransactionPartnerOtherType `json:"type"`
}
// Describes a Telegram Star transaction. Note that if the buyer initiates a chargeback with the payment provider from whom they acquired Stars (e.g., Apple, Google) following this transaction, the refunded Stars will be deducted from the bot's balance. This is outside of Telegram's control.
@@ -5656,7 +5656,7 @@ type PassportFile struct {
// Describes documents or other Telegram Passport elements shared with the bot by the user.
type EncryptedPassportElement struct {
// Element type. One of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”, “phone_number”, “email”.
Type string `json:"type"`
Type EncryptedPassportElementType `json:"type"`
// Optional. Base64-encoded encrypted Telegram Passport element data provided by the user; available only for “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport” and “address” types. Can be decrypted and verified using the accompanying EncryptedCredentials.
Data string `json:"data,omitempty"`
// Optional. User's verified phone number; available only for “phone_number” type
@@ -5734,7 +5734,7 @@ type PassportElementErrorDataField struct {
// Error source, must be data
Source string `json:"source"`
// The section of the user's Telegram Passport which has the error, one of “personal_details”, “passport”, “driver_license”, “identity_card”, “internal_passport”, “address”
Type string `json:"type"`
Type PassportElementErrorDataFieldType `json:"type"`
// Name of the data field which has the error
FieldName string `json:"field_name"`
// Base64-encoded data hash
@@ -5748,7 +5748,7 @@ type PassportElementErrorFrontSide struct {
// Error source, must be front_side
Source string `json:"source"`
// The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
Type string `json:"type"`
Type PassportElementErrorSelfieType `json:"type"`
// Base64-encoded hash of the file with the front side of the document
FileHash string `json:"file_hash"`
// Error message
@@ -5760,7 +5760,7 @@ type PassportElementErrorReverseSide struct {
// Error source, must be reverse_side
Source string `json:"source"`
// The section of the user's Telegram Passport which has the issue, one of “driver_license”, “identity_card”
Type string `json:"type"`
Type PassportElementErrorReverseSideType `json:"type"`
// Base64-encoded hash of the file with the reverse side of the document
FileHash string `json:"file_hash"`
// Error message
@@ -5772,7 +5772,7 @@ type PassportElementErrorSelfie struct {
// Error source, must be selfie
Source string `json:"source"`
// The section of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”
Type string `json:"type"`
Type PassportElementErrorSelfieType `json:"type"`
// Base64-encoded hash of the file with the selfie
FileHash string `json:"file_hash"`
// Error message
@@ -5784,7 +5784,7 @@ type PassportElementErrorFile struct {
// Error source, must be file
Source string `json:"source"`
// The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
Type string `json:"type"`
Type PassportElementErrorFileType `json:"type"`
// Base64-encoded file hash
FileHash string `json:"file_hash"`
// Error message
@@ -5796,7 +5796,7 @@ type PassportElementErrorFiles struct {
// Error source, must be files
Source string `json:"source"`
// The section of the user's Telegram Passport which has the issue, one of “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
Type string `json:"type"`
Type PassportElementErrorFileType `json:"type"`
// List of base64-encoded file hashes
FileHashes []string `json:"file_hashes"`
// Error message
@@ -5808,7 +5808,7 @@ type PassportElementErrorTranslationFile struct {
// Error source, must be translation_file
Source string `json:"source"`
// Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
Type string `json:"type"`
Type PassportElementErrorTranslationFileType `json:"type"`
// Base64-encoded file hash
FileHash string `json:"file_hash"`
// Error message
@@ -5820,7 +5820,7 @@ type PassportElementErrorTranslationFiles struct {
// Error source, must be translation_files
Source string `json:"source"`
// Type of element of the user's Telegram Passport which has the issue, one of “passport”, “driver_license”, “identity_card”, “internal_passport”, “utility_bill”, “bank_statement”, “rental_agreement”, “passport_registration”, “temporary_registration”
Type string `json:"type"`
Type PassportElementErrorTranslationFileType `json:"type"`
// List of base64-encoded file hashes
FileHashes []string `json:"file_hashes"`
// Error message