diff --git a/chat.go b/chat.go index 2ed488b3..84dbd5c8 100644 --- a/chat.go +++ b/chat.go @@ -74,6 +74,7 @@ type Chat struct { ProfileBackgroundEmojiID string `json:"profile_background_custom_emoji_id"` HasVisibleHistory bool `json:"has_visible_history"` UnrestrictBoosts int `json:"unrestrict_boost_count"` + MaxReactionCount int `json:"max_reaction_count"` Birthdate Birthdate `json:"birthdate,omitempty"` PersonalChat *Chat `json:"personal_chat,omitempty"` BusinessIntro BusinessIntro `json:"business_intro,omitempty"` @@ -171,6 +172,11 @@ type ChatMemberUpdate struct { // join the chat; for joining by invite link events only. InviteLink *ChatInviteLink `json:"invite_link"` + // (Optional) True, if the user joined the chat after sending + //a direct join request without using an invite link and being + //approved by an administrator + ViaJoinRequest bool `json:"via_join_request"` + // (Optional) True, if the user joined the chat via a chat folder invite link. ViaFolderLink bool `json:"via_chat_folder_invite_link"` } @@ -267,6 +273,60 @@ type Story struct { Poster *Chat `json:"chat"` } +type BackgroundFill struct { + // Type of the background fill, always “solid” + Type string `json:"type"` + + // The color of the background fill in the RGB24 format + Color int `json:"color,omitempty"` + + // Top color of the gradient in the RGB24 format + TopColor int `json:"top_color,omitempty"` + + // Bottom color of the gradient in the RGB24 format + BottomColor int `json:"bottom_color,omitempty"` + + // Clockwise rotation angle of the background fill in degrees; 0-359 + RotationAngle int `json:"rotation_angle,omitempty"` + + // 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,omitempty"` +} + +type BackgroundType struct { + // Type of the background, always “fill” + Type string `json:"type"` + + // The background fill + Fill BackgroundFill `json:"fill,omitempty"` + + // Document with the wallpaper + Document Document `json:"document,omitempty"` + + // Dimming of the background in dark themes, as a percentage; 0-100 + DarkThemeDimming int `json:"dark_theme_dimming,omitempty"` + + // Intensity of the pattern when it is shown above the filled background; 0-100 + Intensity int `json:"intensity,omitempty"` + + // (Optional) True, if the wallpaper is downscaled to fit in a 450x450 + // square and then box-blurred with radius 12 + IsBlurred bool `json:"is_blurred,omitempty"` + + // (Optional) True, if the background moves slightly when the device is tilted + IsMoving bool `json:"is_moving,omitempty"` + + // (Optional) 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 + IsInverted bool `json:"is_inverted,omitempty"` +} + +type ChatBackground struct { + // Type of the background + Type BackgroundType `json:"type"` +} + type Birthdate struct { // Day of the user's birth; 1-31 Day int `json:"day"` diff --git a/media.go b/media.go index bdce5557..2af63deb 100644 --- a/media.go +++ b/media.go @@ -2,8 +2,12 @@ package telebot import ( "encoding/json" + "math" ) +// Alias for math.MaxInt32 +const LiveForever = math.MaxInt32 + // Media is a generic type for all kinds of media that includes File. type Media interface { // MediaType returns string-represented media type. diff --git a/message.go b/message.go index 7ede6724..f8a848a3 100644 --- a/message.go +++ b/message.go @@ -313,6 +313,9 @@ type Message struct { // Service message: user boosted the chat. BoostAdded *BoostAdded `json:"boost_added"` + // Service message: chat background set + ChatBackgroundSet ChatBackground `json:"chat_background_set"` + // If the sender of the message boosted the chat, the number of boosts // added by the user. SenderBoostCount int `json:"sender_boost_count"` diff --git a/poll.go b/poll.go index 48018e7b..196d562d 100644 --- a/poll.go +++ b/poll.go @@ -24,12 +24,14 @@ type Poll struct { VoterCount int `json:"total_voter_count"` // (Optional) - Closed bool `json:"is_closed,omitempty"` - CorrectOption int `json:"correct_option_id,omitempty"` - MultipleAnswers bool `json:"allows_multiple_answers,omitempty"` - Explanation string `json:"explanation,omitempty"` - ParseMode ParseMode `json:"explanation_parse_mode,omitempty"` - Entities []MessageEntity `json:"explanation_entities"` + Closed bool `json:"is_closed,omitempty"` + CorrectOption int `json:"correct_option_id,omitempty"` + MultipleAnswers bool `json:"allows_multiple_answers,omitempty"` + Explanation string `json:"explanation,omitempty"` + ParseMode ParseMode `json:"explanation_parse_mode,omitempty"` + Entities []MessageEntity `json:"explanation_entities"` + QuestionEntities []MessageEntity `json:"question_entities"` + QuestionParseMode string `json:"question_parse_mode"` // True by default, shouldn't be omitted. Anonymous bool `json:"is_anonymous"` @@ -43,6 +45,10 @@ type Poll struct { type PollOption struct { Text string `json:"text"` VoterCount int `json:"voter_count"` + + // (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"` } // PollAnswer represents an answer of a user in a non-anonymous poll.