diff --git a/methods.go b/methods.go index 7057916..2335c33 100644 --- a/methods.go +++ b/methods.go @@ -713,6 +713,13 @@ func (b *Bot) DeleteStickerFromSet(ctx context.Context, params *DeleteStickerFro return result, err } +// ReplaceStickerInSet https://core.telegram.org/bots/api#replacestickerinset +func (b *Bot) ReplaceStickerInSet(ctx context.Context, params *ReplaceStickerInSetParams) (bool, error) { + var result bool + err := b.rawRequest(ctx, "replaceStickerInSet", params, &result) + return result, err +} + // SetStickerEmojiList https://core.telegram.org/bots/api#setstickeremojilist func (b *Bot) SetStickerEmojiList(ctx context.Context, params *SetStickerEmojiListParams) (bool, error) { var result bool diff --git a/methods_params.go b/methods_params.go index 5188360..b064e96 100644 --- a/methods_params.go +++ b/methods_params.go @@ -20,16 +20,17 @@ type DeleteWebhookParams struct { // SendMessageParams https://core.telegram.org/bots/api#sendmessage type SendMessageParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Text string `json:"text"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - Entities []models.MessageEntity `json:"entities,omitempty"` - LinkPreviewOptions *models.LinkPreviewOptions `json:"link_preview_options,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Text string `json:"text"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + Entities []models.MessageEntity `json:"entities,omitempty"` + LinkPreviewOptions *models.LinkPreviewOptions `json:"link_preview_options,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // ForwardMessageParams https://core.telegram.org/bots/api#forwardmessage @@ -80,39 +81,42 @@ type CopyMessagesParams struct { // SendPhotoParams https://core.telegram.org/bots/api#sendphoto type SendPhotoParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Photo models.InputFile `json:"photo"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - HasSpoiler bool `json:"has_spoiler,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Photo models.InputFile `json:"photo"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + HasSpoiler bool `json:"has_spoiler,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendAudioParams https://core.telegram.org/bots/api#sendaudio type SendAudioParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Audio models.InputFile `json:"audio"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - Duration int `json:"duration,omitempty"` - Performer string `json:"performer,omitempty"` - Title string `json:"title,omitempty"` - Thumbnail models.InputFile `json:"thumbnail,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Audio models.InputFile `json:"audio"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + Duration int `json:"duration,omitempty"` + Performer string `json:"performer,omitempty"` + Title string `json:"title,omitempty"` + Thumbnail models.InputFile `json:"thumbnail,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendDocumentParams https://core.telegram.org/bots/api#senddocument type SendDocumentParams struct { + BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` Document models.InputFile `json:"document"` @@ -129,84 +133,90 @@ type SendDocumentParams struct { // SendVideoParams https://core.telegram.org/bots/api#sendvideo type SendVideoParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Video models.InputFile `json:"video"` - Duration int `json:"duration,omitempty"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` - Thumbnail models.InputFile `json:"thumbnail,omitempty"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - HasSpoiler bool `json:"has_spoiler,omitempty"` - SupportsStreaming bool `json:"supports_streaming,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Video models.InputFile `json:"video"` + Duration int `json:"duration,omitempty"` + Width int `json:"width,omitempty"` + Height int `json:"height,omitempty"` + Thumbnail models.InputFile `json:"thumbnail,omitempty"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + HasSpoiler bool `json:"has_spoiler,omitempty"` + SupportsStreaming bool `json:"supports_streaming,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendAnimationParams https://core.telegram.org/bots/api#sendanimation type SendAnimationParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Animation models.InputFile `json:"animation"` - Duration int `json:"duration,omitempty"` - Width int `json:"width,omitempty"` - Height int `json:"height,omitempty"` - Thumbnail models.InputFile `json:"thumbnail,omitempty"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - HasSpoiler bool `json:"has_spoiler,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Animation models.InputFile `json:"animation"` + Duration int `json:"duration,omitempty"` + Width int `json:"width,omitempty"` + Height int `json:"height,omitempty"` + Thumbnail models.InputFile `json:"thumbnail,omitempty"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + HasSpoiler bool `json:"has_spoiler,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendVoiceParams https://core.telegram.org/bots/api#sendvoice type SendVoiceParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Voice models.InputFile `json:"voice"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - Duration int `json:"duration,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Voice models.InputFile `json:"voice"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + Duration int `json:"duration,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendVideoNoteParams https://core.telegram.org/bots/api#sendvideonote type SendVideoNoteParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - VideoNote models.InputFile `json:"video_note"` - Duration int `json:"duration,omitempty"` - Length int `json:"length,omitempty"` - Thumbnail models.InputFile `json:"thumbnail,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + VideoNote models.InputFile `json:"video_note"` + Duration int `json:"duration,omitempty"` + Length int `json:"length,omitempty"` + Thumbnail models.InputFile `json:"thumbnail,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendMediaGroupParams https://core.telegram.org/bots/api#sendmediagroup type SendMediaGroupParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Media []models.InputMedia `json:"media"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Media []models.InputMedia `json:"media"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` } // SendLocationParams https://core.telegram.org/bots/api#sendlocation type SendLocationParams struct { + BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` Latitude float64 `json:"latitude"` @@ -242,38 +252,41 @@ type StopMessageLiveLocationParams struct { // SendVenueParams https://core.telegram.org/bots/api#sendvenue type SendVenueParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Latitude float64 `json:"latitude"` - Longitude float64 `json:"longitude"` - Title string `json:"title"` - Address string `json:"address"` - FoursquareID string `json:"foursquare_id,omitempty"` - FoursquareType string `json:"foursquare_type,omitempty"` - GooglePlaceID string `json:"google_place_id,omitempty"` - GooglePlaceType string `json:"google_place_type,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + Title string `json:"title"` + Address string `json:"address"` + FoursquareID string `json:"foursquare_id,omitempty"` + FoursquareType string `json:"foursquare_type,omitempty"` + GooglePlaceID string `json:"google_place_id,omitempty"` + GooglePlaceType string `json:"google_place_type,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendContactParams https://core.telegram.org/bots/api#sendcontact type SendContactParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - PhoneNumber string `json:"phone_number"` - FirstName string `json:"first_name"` - LastName string `json:"last_name,omitempty"` - VCard string `json:"vcard,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + PhoneNumber string `json:"phone_number"` + FirstName string `json:"first_name"` + LastName string `json:"last_name,omitempty"` + VCard string `json:"vcard,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendPollParams https://core.telegram.org/bots/api#sendpoll type SendPollParams struct { + BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` MessageThreadID int `json:"message_thread_id,omitempty"` Question string `json:"question"` @@ -296,19 +309,21 @@ type SendPollParams struct { // SendDiceParams https://core.telegram.org/bots/api#senddice type SendDiceParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Emoji string `json:"emoji,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Emoji string `json:"emoji,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type SendChatActionParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Action models.ChatAction `json:"action"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Action models.ChatAction `json:"action"` } // SetMessageReactionParams https://core.telegram.org/bots/api#setmessagereaction @@ -685,14 +700,15 @@ type DeleteMessagesParams struct { // SendStickerParams https://core.telegram.org/bots/api#sendsticker type SendStickerParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Sticker models.InputFile `json:"sticker"` - Emoji string `json:"emoji,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + Sticker models.InputFile `json:"sticker"` + Emoji string `json:"emoji,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type GetStickerSetParams struct { @@ -713,7 +729,6 @@ type CreateNewStickerSetParams struct { Name string `json:"name"` Title string `json:"title"` Sticker models.InputFile `json:"sticker"` - StickerFormat string `json:"sticker_format"` StickerType string `json:"sticker_type,omitempty"` NeedsRepainting bool `json:"needs_repainting,omitempty"` } @@ -733,6 +748,13 @@ type DeleteStickerFromSetParams struct { Sticker string `json:"sticker"` } +type ReplaceStickerInSetParams struct { + UserID int64 `json:"user_id"` + Name string `json:"name"` + OldSticker string `json:"old_sticker"` + Sticker models.InputSticker `json:"sticker"` +} + type SetStickerEmojiListParams struct { Sticker string `json:"sticker"` EmojiList []string `json:"emoji_list"` @@ -756,7 +778,8 @@ type SetStickerSetTitleParams struct { type SetStickerSetThumbnailParams struct { Name string `json:"name"` UserID int64 `json:"user_id"` - Thumbnail models.InputFile `json:"thumbnail"` + Thumbnail models.InputFile `json:"thumbnail,omitempty"` + Format string `json:"format"` } type SetCustomEmojiStickerSetThumbnailParams struct { @@ -856,13 +879,14 @@ type SetPassportDataErrorsParams struct { // SendGameParams https://core.telegram.org/bots/api#sendgame type SendGameParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - GameShorName string `json:"game_short_name"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + GameShorName string `json:"game_short_name"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type SetGameScoreParams struct { diff --git a/models/business.go b/models/business.go new file mode 100644 index 0000000..d0a8b91 --- /dev/null +++ b/models/business.go @@ -0,0 +1,43 @@ +package models + +// BusinessConnection https://core.telegram.org/bots/api#businessconnection +type BusinessConnection struct { + ID string `json:"id"` + User User `json:"user"` + UserChatID int64 `json:"user_chat_id"` + Date int64 `json:"date"` + CanReply bool `json:"can_reply"` + IsEnabled bool `json:"is_enabled"` +} + +// BusinessMessagesDeleted https://core.telegram.org/bots/api#businessmessagesdeleted +type BusinessMessagesDeleted struct { + BusinessConnectionID string `json:"business_connection_id"` + Chat Chat `json:"chat"` + MessageIDs []int `json:"message_ids"` +} + +// BusinessIntro https://core.telegram.org/bots/api#businessintro +type BusinessIntro struct { + Title string `json:"title,omitempty"` + Message string `json:"message,omitempty"` + Sticker *Sticker `json:"sticker,omitempty"` +} + +// BusinessLocation https://core.telegram.org/bots/api#businesslocation +type BusinessLocation struct { + Address string `json:"address"` + Location *Location `json:"location,omitempty"` +} + +// BusinessOpeningHours https://core.telegram.org/bots/api#businessopeninghours +type BusinessOpeningHours struct { + TimeZoneName string `json:"time_zone_name"` + OpeningHours []BusinessOpeningHoursInterval `json:"opening_hours"` +} + +// BusinessOpeningHoursInterval https://core.telegram.org/bots/api#businessopeninghoursinterval +type BusinessOpeningHoursInterval struct { + OpeningMinute int `json:"opening_minute"` + ClosingMinute int `json:"closing_minute"` +} diff --git a/models/chat.go b/models/chat.go index a32e197..3bf8479 100644 --- a/models/chat.go +++ b/models/chat.go @@ -74,43 +74,54 @@ type ChatLocation struct { Address string `json:"address"` } +type Birthdate struct { + Day int `json:"day"` + Month int `json:"month"` + Year int `json:"year,omitempty"` +} + // Chat https://core.telegram.org/bots/api#chat type Chat struct { - ID int64 `json:"id"` - Type string `json:"type"` - Title string `json:"title,omitempty"` - Username string `json:"username,omitempty"` - FirstName string `json:"first_name,omitempty"` - LastName string `json:"last_name,omitempty"` - IsForum bool `json:"is_forum,omitempty"` - Photo *ChatPhoto `json:"photo,omitempty"` - ActiveUsernames []string `json:"active_usernames,omitempty"` - AvailableReactions []ReactionType `json:"available_reactions,omitempty"` - AccentColorID int `json:"accent_color_id,omitempty"` - BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"` - ProfileAccentColorID int `json:"profile_accent_color_id,omitempty"` - ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"` - EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` - EmojiStatusExpirationDate int `json:"emoji_status_expiration_date,omitempty"` - Bio string `json:"bio"` - HasPrivateForwards bool `json:"has_private_forwards,omitempty"` - HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"` - JoinToSendMessages bool `json:"join_to_send_messages"` - JoinByRequest bool `json:"join_by_request"` - Description string `json:"description,omitempty"` - InviteLink string `json:"invite_link,omitempty"` - PinnedMessage *Message `json:"pinned_message,omitempty"` - Permissions *ChatPermissions `json:"permissions,omitempty"` - SlowModeDelay int `json:"slow_mode_delay,omitempty"` - UnrestrictBoostCount int `json:"unrestrict_boost_count,omitempty"` - MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"` - HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"` - HasHiddenMembers bool `json:"has_hidden_members,omitempty"` - HasProtectedContent bool `json:"has_protected_content,omitempty"` - HasVisibleHistory bool `json:"has_visible_history,omitempty"` - StickerSetName string `json:"sticker_set_name,omitempty"` - CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` - CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"` - LinkedChatID int64 `json:"linked_chat_id,omitempty"` - Location *ChatLocation `json:"location,omitempty"` + ID int64 `json:"id"` + Type string `json:"type"` + Title string `json:"title,omitempty"` + Username string `json:"username,omitempty"` + FirstName string `json:"first_name,omitempty"` + LastName string `json:"last_name,omitempty"` + IsForum bool `json:"is_forum,omitempty"` + Photo *ChatPhoto `json:"photo,omitempty"` + ActiveUsernames []string `json:"active_usernames,omitempty"` + Birthdate Birthdate `json:"birthdate,omitempty"` + BusinessIntro *BusinessIntro `json:"business_intro,omitempty"` + BusinessLocation *BusinessLocation `json:"business_location,omitempty"` + BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"` + PersonalChat *Chat `json:"personal_chat,omitempty"` + AvailableReactions []ReactionType `json:"available_reactions,omitempty"` + AccentColorID int `json:"accent_color_id,omitempty"` + BackgroundCustomEmojiID string `json:"background_custom_emoji_id,omitempty"` + ProfileAccentColorID int `json:"profile_accent_color_id,omitempty"` + ProfileBackgroundCustomEmojiID string `json:"profile_background_custom_emoji_id,omitempty"` + EmojiStatusCustomEmojiID string `json:"emoji_status_custom_emoji_id,omitempty"` + EmojiStatusExpirationDate int `json:"emoji_status_expiration_date,omitempty"` + Bio string `json:"bio"` + HasPrivateForwards bool `json:"has_private_forwards,omitempty"` + HasRestrictedVoiceAndVideoMessages bool `json:"has_restricted_voice_and_video_messages,omitempty"` + JoinToSendMessages bool `json:"join_to_send_messages"` + JoinByRequest bool `json:"join_by_request"` + Description string `json:"description,omitempty"` + InviteLink string `json:"invite_link,omitempty"` + PinnedMessage *Message `json:"pinned_message,omitempty"` + Permissions *ChatPermissions `json:"permissions,omitempty"` + SlowModeDelay int `json:"slow_mode_delay,omitempty"` + UnrestrictBoostCount int `json:"unrestrict_boost_count,omitempty"` + MessageAutoDeleteTime int `json:"message_auto_delete_time,omitempty"` + HasAggressiveAntiSpamEnabled bool `json:"has_aggressive_anti_spam_enabled,omitempty"` + HasHiddenMembers bool `json:"has_hidden_members,omitempty"` + HasProtectedContent bool `json:"has_protected_content,omitempty"` + HasVisibleHistory bool `json:"has_visible_history,omitempty"` + StickerSetName string `json:"sticker_set_name,omitempty"` + CanSetStickerSet bool `json:"can_set_sticker_set,omitempty"` + CustomEmojiStickerSetName string `json:"custom_emoji_sticker_set_name,omitempty"` + LinkedChatID int64 `json:"linked_chat_id,omitempty"` + Location *ChatLocation `json:"location,omitempty"` } diff --git a/models/forum.go b/models/forum.go index 5457cfa..6684199 100644 --- a/models/forum.go +++ b/models/forum.go @@ -43,16 +43,28 @@ type UserShared struct { UserID int64 `json:"user_id"` } +// SharedUser https://core.telegram.org/bots/api#shareduser +type SharedUser struct { + UserID int64 `json:"user_id"` + FirstName string `json:"first_name,omitempty"` + LastName string `json:"last_name,omitempty"` + Username string `json:"username,omitempty"` + Photo []PhotoSize `json:"photo,omitempty"` +} + // UsersShared https://core.telegram.org/bots/api#usersshared type UsersShared struct { - RequestID int `json:"request_id"` - UserIDs []int64 `json:"user_ids"` + RequestID int `json:"request_id"` + Users []SharedUser `json:"users"` } // ChatShared https://core.telegram.org/bots/api#chatshared type ChatShared struct { - RequestID int `json:"request_id"` - ChatID int64 `json:"chat_id"` + RequestID int `json:"request_id"` + ChatID int64 `json:"chat_id"` + Title string `json:"title,omitempty"` + Username string `json:"username,omitempty"` + Photo []PhotoSize `json:"photo,omitempty"` } // WriteAccessAllowed https://core.telegram.org/bots/api#writeaccessallowed diff --git a/models/message.go b/models/message.go index 7bc854b..bad420e 100644 --- a/models/message.go +++ b/models/message.go @@ -63,7 +63,9 @@ type Message struct { From *User `json:"from,omitempty"` SenderChat *Chat `json:"sender_chat,omitempty"` SenderBoostCount int `json:"sender_boost_count,omitempty"` + SenderBusinessBot *User `json:"sender_business_bot,omitempty"` Date int `json:"date"` + BusinessConnectionID string `json:"business_connection_id,omitempty"` Chat Chat `json:"chat"` ForwardOrigin *MessageOrigin `json:"forward_origin,omitempty"` IsTopicMessage bool `json:"is_topic_message,omitempty"` @@ -75,6 +77,7 @@ type Message struct { ViaBot *User `json:"via_bot,omitempty"` EditDate int `json:"edit_date,omitempty"` HasProtectedContent bool `json:"has_protected_content,omitempty"` + IsFromOffline bool `json:"is_from_offline,omitempty"` MediaGroupID string `json:"media_group_id,omitempty"` AuthorSignature string `json:"author_signature,omitempty"` Text string `json:"text,omitempty"` diff --git a/models/reply_markup.go b/models/reply_markup.go index 7031584..e4d2d53 100644 --- a/models/reply_markup.go +++ b/models/reply_markup.go @@ -69,10 +69,13 @@ type KeyboardButtonRequestUser struct { // KeyboardButtonRequestUsers https://core.telegram.org/bots/api#keyboardbuttonrequestusers type KeyboardButtonRequestUsers struct { - RequestID int32 `json:"request_id"` - UserIsBot bool `json:"user_is_bot,omitempty"` - UserIsPremium bool `json:"user_is_premium,omitempty"` - MaxQuantity int `json:"max_quantity,omitempty"` + RequestID int32 `json:"request_id"` + UserIsBot bool `json:"user_is_bot,omitempty"` + UserIsPremium bool `json:"user_is_premium,omitempty"` + MaxQuantity int `json:"max_quantity,omitempty"` + RequestName bool `json:"request_name,omitempty"` + RequestUsername bool `json:"request_username,omitempty"` + RequestPhoto bool `json:"request_photo,omitempty"` } // KeyboardButtonRequestChat https://core.telegram.org/bots/api#keyboardbuttonrequestchat @@ -85,6 +88,9 @@ type KeyboardButtonRequestChat struct { UserAdministratorRights *ChatAdministratorRights `json:"user_administrator_rights,omitempty"` BotAdministratorRights *ChatAdministratorRights `json:"bot_administrator_rights,omitempty"` BotIsMember bool `json:"bot_is_member,omitempty"` + RequestTitle bool `json:"request_title,omitempty"` + RequestUsername bool `json:"request_username,omitempty"` + RequestPhoto bool `json:"request_photo,omitempty"` } // KeyboardButtonPollType https://core.telegram.org/bots/api#keyboardbuttonpolltype diff --git a/models/sticker.go b/models/sticker.go index 013ffdf..d740efe 100644 --- a/models/sticker.go +++ b/models/sticker.go @@ -30,6 +30,7 @@ type Sticker struct { // InputSticker https://core.telegram.org/bots/api#inputsticker type InputSticker struct { Sticker InputFile `json:"sticker"` + Format string `json:"format"` EmojiList []string `json:"emoji_list"` MaskPosition MaskPosition `json:"mask_position,omitempty"` Keywords []string `json:"keywords,omitempty"` diff --git a/models/sticker_set.go b/models/sticker_set.go index 07e6fcd..93206c7 100644 --- a/models/sticker_set.go +++ b/models/sticker_set.go @@ -2,12 +2,9 @@ package models // StickerSet https://core.telegram.org/bots/api#stickerset type StickerSet struct { - Name string `json:"name"` - Title string `json:"title"` - StickerType string `json:"sticker_type"` - IsAnimated bool `json:"is_animated"` - IsVideo bool `json:"is_video"` - ContainsMasks bool `json:"contains_masks"` - Stickers []Sticker `json:"stickers"` - Thumbnail *PhotoSize `json:"thumbnail,omitempty"` + Name string `json:"name"` + Title string `json:"title"` + StickerType string `json:"sticker_type"` + Stickers []Sticker `json:"stickers"` + Thumbnail *PhotoSize `json:"thumbnail,omitempty"` } diff --git a/models/update.go b/models/update.go index 3e8b691..18ff7ef 100644 --- a/models/update.go +++ b/models/update.go @@ -2,23 +2,27 @@ package models // Update https://core.telegram.org/bots/api#update type Update struct { - ID int64 `json:"update_id"` - Message *Message `json:"message,omitempty"` - EditedMessage *Message `json:"edited_message,omitempty"` - ChannelPost *Message `json:"channel_post,omitempty"` - EditedChannelPost *Message `json:"edited_channel_post,omitempty"` - MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"` - MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"` - InlineQuery *InlineQuery `json:"inline_query,omitempty"` - ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` - CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` - ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` - PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` - Poll *Poll `json:"poll,omitempty"` - PollAnswer *PollAnswer `json:"poll_answer,omitempty"` - MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"` - ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"` - ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"` - ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"` - RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` + ID int64 `json:"update_id"` + Message *Message `json:"message,omitempty"` + EditedMessage *Message `json:"edited_message,omitempty"` + ChannelPost *Message `json:"channel_post,omitempty"` + EditedChannelPost *Message `json:"edited_channel_post,omitempty"` + BusinessConnection *BusinessConnection `json:"business_connection,omitempty"` + BusinessMessage *Message `json:"business_message,omitempty"` + EditedBusinessMessage *Message `json:"edited_business_message,omitempty"` + DeletedBusinessMessages *BusinessMessagesDeleted `json:"deleted_business_messages,omitempty"` + MessageReaction *MessageReactionUpdated `json:"message_reaction,omitempty"` + MessageReactionCount *MessageReactionCountUpdated `json:"message_reaction_count,omitempty"` + InlineQuery *InlineQuery `json:"inline_query,omitempty"` + ChosenInlineResult *ChosenInlineResult `json:"chosen_inline_result,omitempty"` + CallbackQuery *CallbackQuery `json:"callback_query,omitempty"` + ShippingQuery *ShippingQuery `json:"shipping_query,omitempty"` + PreCheckoutQuery *PreCheckoutQuery `json:"pre_checkout_query,omitempty"` + Poll *Poll `json:"poll,omitempty"` + PollAnswer *PollAnswer `json:"poll_answer,omitempty"` + MyChatMember *ChatMemberUpdated `json:"my_chat_member,omitempty"` + ChatMember *ChatMemberUpdated `json:"chat_member,omitempty"` + ChatJoinRequest *ChatJoinRequest `json:"chat_join_request,omitempty"` + ChatBoost *ChatBoostUpdated `json:"chat_boost,omitempty"` + RemovedChatBoost *ChatBoostRemoved `json:"removed_chat_boost,omitempty"` } diff --git a/models/user.go b/models/user.go index 6603885..d7b4454 100644 --- a/models/user.go +++ b/models/user.go @@ -19,4 +19,5 @@ type User struct { CanJoinGroups bool `json:"can_join_groups,omitempty"` CanReadAllGroupMessages bool `json:"can_read_all_group_messages,omitempty"` SupportInlineQueries bool `json:"support_inline_queries,omitempty"` + CanConnectToBusiness bool `json:"can_connect_to_business,omitempty"` }