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
//
// 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 @@ type InputPollOption struct {
// 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 @@ type Poll struct {
// 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 @@ type BackgroundFill struct {
// - 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 @@ type BackgroundType struct {
// - 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"`
}