add missed omitempty tag & update comments

master^2
stdkhai 2024-05-10 17:19:52 +03:00
parent 1ad852c765
commit 3dfc49d5c1
1 changed files with 20 additions and 7 deletions

View File

@ -1543,7 +1543,7 @@ type PollOption struct {
// Currently, only custom emoji entities are allowed in poll option texts // Currently, only custom emoji entities are allowed in poll option texts
// //
// optional // optional
TextEntities []MessageEntity `json:"text_entities"` TextEntities []MessageEntity `json:"text_entities,omitempty"`
// VoterCount is the number of users that voted for this option // VoterCount is the number of users that voted for this option
VoterCount int `json:"voter_count"` VoterCount int `json:"voter_count"`
} }
@ -1556,12 +1556,12 @@ type InputPollOption struct {
// Currently, only custom emoji entities are allowed // Currently, only custom emoji entities are allowed
// //
// optional // 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. // A JSON-serialized list of special entities that appear in the poll option text.
// It can be specified instead of text_parse_mode // It can be specified instead of text_parse_mode
// //
// optional // optional
TextEntities []MessageEntity `json:"text_entities"` TextEntities []MessageEntity `json:"text_entities,omitempty"`
} }
// PollAnswer represents an answer of a user in a non-anonymous poll. // PollAnswer represents an answer of a user in a non-anonymous poll.
@ -1593,7 +1593,7 @@ type Poll struct {
// Currently, only custom emoji entities are allowed in poll questions // Currently, only custom emoji entities are allowed in poll questions
// //
// optional // optional
QuestionEntities []MessageEntity `json:"question_entities"` QuestionEntities []MessageEntity `json:"question_entities,omitempty"`
// Options is the list of poll options // Options is the list of poll options
Options []PollOption `json:"options"` Options []PollOption `json:"options"`
// TotalVoterCount is the total numbers of users who voted in the poll // TotalVoterCount is the total numbers of users who voted in the poll
@ -1733,14 +1733,19 @@ type BackgroundFill struct {
// - gradient // - gradient
// - freeform_gradient // - freeform_gradient
Type string `json:"type"` Type string `json:"type"`
// BackgroundFillSolid only.
// The color of the background fill in the RGB24 format // The color of the background fill in the RGB24 format
Color int `json:"color"` Color int `json:"color"`
// BackgroundFillGradient only.
// Top color of the gradient in the RGB24 format // Top color of the gradient in the RGB24 format
TopColor int `json:"top_color"` TopColor int `json:"top_color"`
// BackgroundFillGradient only.
// Bottom color of the gradient in the RGB24 format // Bottom color of the gradient in the RGB24 format
BottomColor int `json:"bottom_color"` BottomColor int `json:"bottom_color"`
// BackgroundFillGradient only.
// Clockwise rotation angle of the background fill in degrees; 0-359 // Clockwise rotation angle of the background fill in degrees; 0-359
RotationAngle int `json:"rotation_angle"` 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 // 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"` Colors []int `json:"colors"`
} }
@ -1758,27 +1763,35 @@ type BackgroundType struct {
// - pattern // - pattern
// - chat_theme // - chat_theme
Type string `json:"type"` Type string `json:"type"`
// BackgroundTypeFill and BackgroundTypePattern only.
// The background fill or fill that is combined with the pattern // The background fill or fill that is combined with the pattern
Fill BackgroundFill `json:"fill"` Fill BackgroundFill `json:"fill"`
// BackgroundTypeFill and BackgroundTypeWallpaper only.
// Dimming of the background in dark themes, as a percentage; 0-100 // Dimming of the background in dark themes, as a percentage; 0-100
DarkThemeDimming int `json:"dark_theme_dimming"` DarkThemeDimming int `json:"dark_theme_dimming"`
// BackgroundTypeWallpaper and BackgroundTypePattern only.
// Document with the wallpaper / pattern // Document with the wallpaper / pattern
Document Document `json:"document"` 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 // True, if the wallpaper is downscaled to fit in a 450x450 square and then box-blurred with radius 12
// //
// optional // 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 // True, if the background moves slightly when the device is tilted
// //
// optional // 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 of the pattern when it is shown above the filled background; 0-100
Intensity int `json:"intensity"` Intensity int `json:"intensity"`
// BackgroundTypePattern only.
// True, if the background fill must be applied only to the pattern itself. // 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 // All other pixels are black in this case. For dark themes only
// //
// optional // optional
IsInverted bool `json:"is_inverted"` IsInverted bool `json:"is_inverted,omitempty"`
// BackgroundTypeChatTheme only.
// Name of the chat theme, which is usually an emoji // Name of the chat theme, which is usually an emoji
ThemeName string `json:"theme_name"` ThemeName string `json:"theme_name"`
} }