all repos — telegram-bot-api @ 3dfc49d5c1144743b3911cc8ff22b49f114aca8e

Golang bindings for the Telegram Bot API

add missed omitempty tag & update comments
stdkhai k.o.zhuk@student.khai.edu
Fri, 10 May 2024 17:19:52 +0300
commit

3dfc49d5c1144743b3911cc8ff22b49f114aca8e

parent

1ad852c7652bb1c0226da1214678f9dc70dcf3d5

1 files changed, 20 insertions(+), 7 deletions(-)

jump to
M types.gotypes.go

@@ -1543,7 +1543,7 @@ // Special entities that appear in the option text.

// Currently, only custom emoji entities are allowed in poll option texts // // optional - TextEntities []MessageEntity `json:"text_entities"` + TextEntities []MessageEntity `json:"text_entities,omitempty"` // VoterCount is the number of users that voted for this option VoterCount int `json:"voter_count"` }

@@ -1556,12 +1556,12 @@ // Mode for parsing entities in the text. See formatting options for more details.

// Currently, only custom emoji entities are allowed // // optional - TextParseMode string `json:"text_parse_mode"` + TextParseMode string `json:"text_parse_mode,omitempty"` // A JSON-serialized list of special entities that appear in the poll option text. // It can be specified instead of text_parse_mode // // optional - TextEntities []MessageEntity `json:"text_entities"` + TextEntities []MessageEntity `json:"text_entities,omitempty"` } // PollAnswer represents an answer of a user in a non-anonymous poll.

@@ -1593,7 +1593,7 @@ // Special entities that appear in the question.

// Currently, only custom emoji entities are allowed in poll questions // // optional - QuestionEntities []MessageEntity `json:"question_entities"` + QuestionEntities []MessageEntity `json:"question_entities,omitempty"` // Options is the list of poll options Options []PollOption `json:"options"` // TotalVoterCount is the total numbers of users who voted in the poll

@@ -1733,14 +1733,19 @@ // - solid

// - gradient // - freeform_gradient Type string `json:"type"` + // BackgroundFillSolid only. // The color of the background fill in the RGB24 format Color int `json:"color"` + // BackgroundFillGradient only. // Top color of the gradient in the RGB24 format TopColor int `json:"top_color"` + // BackgroundFillGradient only. // Bottom color of the gradient in the RGB24 format BottomColor int `json:"bottom_color"` + // BackgroundFillGradient only. // Clockwise rotation angle of the background fill in degrees; 0-359 RotationAngle int `json:"rotation_angle"` + // BackgroundFillFreeformGradient only. // A list of the 3 or 4 base colors that are used to generate the freeform gradient in the RGB24 format Colors []int `json:"colors"` }

@@ -1758,27 +1763,35 @@ // - wallpaper

// - pattern // - chat_theme Type string `json:"type"` + // BackgroundTypeFill and BackgroundTypePattern only. // The background fill or fill that is combined with the pattern Fill BackgroundFill `json:"fill"` + // BackgroundTypeFill and BackgroundTypeWallpaper only. // Dimming of the background in dark themes, as a percentage; 0-100 DarkThemeDimming int `json:"dark_theme_dimming"` + // BackgroundTypeWallpaper and BackgroundTypePattern only. // Document with the wallpaper / pattern Document Document `json:"document"` + // BackgroundTypeWallpaper only. // True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12 // // optional - IsBlurred bool `json:"is_blurred"` + IsBlurred bool `json:"is_blurred,omitempty"` + // BackgroundTypeWallpaper and BackgroundTypePattern only. // True, if the background moves slightly when the device is tilted // // optional - IsMoving bool `json:"is_moving"` + IsMoving bool `json:"is_moving,omitempty"` + // BackgroundTypePattern only. // Intensity of the pattern when it is shown above the filled background; 0-100 Intensity int `json:"intensity"` + // BackgroundTypePattern only. // True, if the background fill must be applied only to the pattern itself. // All other pixels are black in this case. For dark themes only // // optional - IsInverted bool `json:"is_inverted"` + IsInverted bool `json:"is_inverted,omitempty"` + // BackgroundTypeChatTheme only. // Name of the chat theme, which is usually an emoji ThemeName string `json:"theme_name"` }