From 1c59e865683e2dcb7398bfb07cb1bbb892ce432c Mon Sep 17 00:00:00 2001 From: negasus Date: Mon, 18 Aug 2025 17:01:06 +0300 Subject: [PATCH] api 9.2 --- methods.go | 14 + methods_params.go | 643 +++++++++++++++++++++------------------ models/chat.go | 48 +-- models/chat_member.go | 39 +-- models/gift.go | 14 +- models/message.go | 15 + models/reply.go | 1 + models/suggested_post.go | 53 ++++ 8 files changed, 485 insertions(+), 342 deletions(-) create mode 100644 models/suggested_post.go diff --git a/methods.go b/methods.go index 03cc775..34f8274 100644 --- a/methods.go +++ b/methods.go @@ -692,6 +692,20 @@ func (b *Bot) StopPoll(ctx context.Context, params *StopPollParams) (*models.Pol return result, err } +// ApproveSuggestedPost https://core.telegram.org/bots/api#approvesuggestedpost +func (b *Bot) ApproveSuggestedPost(ctx context.Context, params *ApproveSuggestedPostParams) (bool, error) { + var result bool + err := b.rawRequest(ctx, "approveSuggestedPost", params, &result) + return result, err +} + +// DeclineSuggestedPost https://core.telegram.org/bots/api#declinesuggestedpost +func (b *Bot) DeclineSuggestedPost(ctx context.Context, params *DeclineSuggestedPostParams) (bool, error) { + var result bool + err := b.rawRequest(ctx, "declineSuggestedPost", params, &result) + return result, err +} + // DeleteMessage https://core.telegram.org/bots/api#deletemessage func (b *Bot) DeleteMessage(ctx context.Context, params *DeleteMessageParams) (bool, error) { var result bool diff --git a/methods_params.go b/methods_params.go index db30387..c87e091 100644 --- a/methods_params.go +++ b/methods_params.go @@ -20,262 +20,290 @@ type DeleteWebhookParams struct { // SendMessageParams https://core.telegram.org/bots/api#sendmessage type SendMessageParams struct { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // ForwardMessageParams https://core.telegram.org/bots/api#forwardmessage type ForwardMessageParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - FromChatID any `json:"from_chat_id"` - VideoStartTimestamp int `json:"video_start_timestamp,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - MessageID int `json:"message_id"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + FromChatID any `json:"from_chat_id"` + VideoStartTimestamp int `json:"video_start_timestamp,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + MessageID int `json:"message_id"` } // ForwardMessagesParams https://core.telegram.org/bots/api#forwardmessages type ForwardMessagesParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - FromChatID any `json:"from_chat_id"` - MessageIDs []int `json:"message_ids"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + FromChatID any `json:"from_chat_id"` + MessageIDs []int `json:"message_ids"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` } // CopyMessageParams https://core.telegram.org/bots/api#copymessage type CopyMessageParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - FromChatID any `json:"from_chat_id"` - MessageID int `json:"message_id"` - VideoStartTimestamp int `json:"video_start_timestamp,omitempty"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + FromChatID any `json:"from_chat_id"` + MessageID int `json:"message_id"` + VideoStartTimestamp int `json:"video_start_timestamp,omitempty"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // CopyMessagesParams https://core.telegram.org/bots/api#copymessages type CopyMessagesParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - FromChatID any `json:"from_chat_id"` - MessageIDs []int `json:"message_ids"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - RemoveCaption bool `json:"remove_caption,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + FromChatID any `json:"from_chat_id"` + MessageIDs []int `json:"message_ids"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + RemoveCaption bool `json:"remove_caption,omitempty"` } // SendPhotoParams https://core.telegram.org/bots/api#sendphoto type SendPhotoParams struct { - 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"` - ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` - HasSpoiler bool `json:"has_spoiler,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` + HasSpoiler bool `json:"has_spoiler,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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 { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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"` - 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"` - DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Document models.InputFile `json:"document"` + 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"` + DisableContentTypeDetection bool `json:"disable_content_type_detection,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendVideoParams https://core.telegram.org/bots/api#sendvideo type SendVideoParams struct { - 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"` - Cover models.InputFile `json:"cover,omitempty"` - StartTimestamp int `json:"start_timestamp,omitempty"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - ShowCaptionAboveMedia bool `json:"show_caption_above_media,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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + Cover models.InputFile `json:"cover,omitempty"` + StartTimestamp int `json:"start_timestamp,omitempty"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + ShowCaptionAboveMedia bool `json:"show_caption_above_media,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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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 { - 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"` - ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` - HasSpoiler bool `json:"has_spoiler,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` + HasSpoiler bool `json:"has_spoiler,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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 { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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 { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendPaidMediaParams https://core.telegram.org/bots/api#sendpaidmedia type SendPaidMediaParams struct { + BusinessConnectionID string `json:"business_connection_id,omitempty"` + ChatID any `json:"chat_id"` + StarCount int `json:"star_count"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Media []models.InputPaidMedia `json:"media"` + Payload string `json:"payload,omitempty"` + Caption string `json:"caption,omitempty"` + ParseMode models.ParseMode `json:"parse_mode,omitempty"` + CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` + ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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 { BusinessConnectionID string `json:"business_connection_id,omitempty"` ChatID any `json:"chat_id"` - StarCount int `json:"star_count"` - Media []models.InputPaidMedia `json:"media"` - Payload string `json:"payload,omitempty"` - Caption string `json:"caption,omitempty"` - ParseMode models.ParseMode `json:"parse_mode,omitempty"` - CaptionEntities []models.MessageEntity `json:"caption_entities,omitempty"` - ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Media []models.InputMedia `json:"media"` DisableNotification bool `json:"disable_notification,omitempty"` ProtectContent bool `json:"protect_content,omitempty"` AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,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 { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` - Longitude float64 `json:"longitude"` - HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` - LivePeriod int `json:"live_period,omitempty"` - Heading int `json:"heading,omitempty"` - ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Latitude float64 `json:"latitude"` + Longitude float64 `json:"longitude"` + HorizontalAccuracy float64 `json:"horizontal_accuracy,omitempty"` + LivePeriod int `json:"live_period,omitempty"` + Heading int `json:"heading,omitempty"` + ProximityAlertRadius int `json:"proximity_alert_radius,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type EditMessageLiveLocationParams struct { @@ -302,40 +330,44 @@ type StopMessageLiveLocationParams struct { // SendVenueParams https://core.telegram.org/bots/api#sendvenue type SendVenueParams struct { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,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 { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_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"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } // SendPollParams https://core.telegram.org/bots/api#sendpoll @@ -379,16 +411,18 @@ type SendChecklistParams struct { // SendDiceParams https://core.telegram.org/bots/api#senddice type SendDiceParams struct { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Emoji string `json:"emoji,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type SendChatActionParams struct { @@ -445,23 +479,24 @@ type RestrictChatMemberParams struct { } type PromoteChatMemberParams struct { - ChatID any `json:"chat_id" rules:"required,chat_id"` - UserID int64 `json:"user_id" rules:"required"` - IsAnonymous bool `json:"is_anonymous,omitempty"` - CanManageChat bool `json:"can_manage_chat,omitempty"` - CanDeleteMessages bool `json:"can_delete_messages,omitempty"` - CanManageVideoChats bool `json:"can_manage_video_chats,omitempty"` - CanRestrictMembers bool `json:"can_restrict_members,omitempty"` - CanPromoteMembers bool `json:"can_promote_members,omitempty"` - CanChangeInfo bool `json:"can_change_info,omitempty"` - CanInviteUsers bool `json:"can_invite_users,omitempty"` - CanPostMessages bool `json:"can_post_messages,omitempty"` - CanEditMessages bool `json:"can_edit_messages,omitempty"` - CanPinMessages bool `json:"can_pin_messages,omitempty"` - CanPostStories bool `json:"can_post_stories,omitempty"` - CanEditStories bool `json:"can_edit_stories,omitempty"` - CanDeleteStories bool `json:"can_delete_stories,omitempty"` - CanManageTopics bool `json:"can_manage_topics,omitempty"` + ChatID any `json:"chat_id" rules:"required,chat_id"` + UserID int64 `json:"user_id" rules:"required"` + IsAnonymous bool `json:"is_anonymous,omitempty"` + CanManageChat bool `json:"can_manage_chat,omitempty"` + CanDeleteMessages bool `json:"can_delete_messages,omitempty"` + CanManageVideoChats bool `json:"can_manage_video_chats,omitempty"` + CanRestrictMembers bool `json:"can_restrict_members,omitempty"` + CanPromoteMembers bool `json:"can_promote_members,omitempty"` + CanChangeInfo bool `json:"can_change_info,omitempty"` + CanInviteUsers bool `json:"can_invite_users,omitempty"` + CanPostMessages bool `json:"can_post_messages,omitempty"` + CanEditMessages bool `json:"can_edit_messages,omitempty"` + CanPinMessages bool `json:"can_pin_messages,omitempty"` + CanPostStories bool `json:"can_post_stories,omitempty"` + CanEditStories bool `json:"can_edit_stories,omitempty"` + CanDeleteStories bool `json:"can_delete_stories,omitempty"` + CanManageTopics bool `json:"can_manage_topics,omitempty"` + CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"` } type SetChatAdministratorCustomTitleParams struct { @@ -798,6 +833,20 @@ type StopPollParams struct { ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } +// ApproveSuggestedPostParams https://core.telegram.org/bots/api#approvesuggestedpost +type ApproveSuggestedPostParams struct { + ChatID int `json:"chat_id"` + MessageID int `json:"message_id"` + SendDate int `json:"send_date,omitempty"` +} + +// DeclineSuggestedPostParams https://core.telegram.org/bots/api#declinesuggestedpost +type DeclineSuggestedPostParams struct { + ChatID int `json:"chat_id"` + MessageID int `json:"message_id"` + Comment string `json:"comment,omitempty"` +} + // DeleteMessageParams https://core.telegram.org/bots/api#deletemessage type DeleteMessageParams struct { ChatID any `json:"chat_id"` @@ -812,17 +861,19 @@ type DeleteMessagesParams struct { // SendStickerParams https://core.telegram.org/bots/api#sendsticker type SendStickerParams struct { - 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"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,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"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Sticker models.InputFile `json:"sticker"` + Emoji string `json:"emoji,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type GetStickerSetParams struct { @@ -932,35 +983,37 @@ type SavePreparedInlineMessageParams struct { // SendInvoiceParams https://core.telegram.org/bots/api#sendinvoice type SendInvoiceParams struct { - ChatID any `json:"chat_id"` - MessageThreadID int `json:"message_thread_id,omitempty"` - Title string `json:"title"` - Description string `json:"description"` - Payload string `json:"payload"` - ProviderToken string `json:"provider_token,omitempty"` - Currency string `json:"currency"` - Prices []models.LabeledPrice `json:"prices"` - MaxTipAmount int `json:"max_tip_amount,omitempty"` - SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"` - StartParameter string `json:"start_parameter,omitempty"` - ProviderData string `json:"provider_data,omitempty"` - PhotoURL string `json:"photo_url,omitempty"` - PhotoSize int `json:"photo_size,omitempty"` - PhotoWidth int `json:"photo_width,omitempty"` - PhotoHeight int `json:"photo_height,omitempty"` - NeedName bool `json:"need_name,omitempty"` - NeedPhoneNumber bool `json:"need_phone_number,omitempty"` - NeedEmail bool `json:"need_email,omitempty"` - NeedShippingAddress bool `json:"need_shipping_address,omitempty"` - SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` - SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` - IsFlexible bool `json:"is_flexible,omitempty"` - DisableNotification bool `json:"disable_notification,omitempty"` - ProtectContent bool `json:"protect_content,omitempty"` - AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` - MessageEffectID string `json:"message_effect_id,omitempty"` - ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` - ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` + ChatID any `json:"chat_id"` + MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"` + Title string `json:"title"` + Description string `json:"description"` + Payload string `json:"payload"` + ProviderToken string `json:"provider_token,omitempty"` + Currency string `json:"currency"` + Prices []models.LabeledPrice `json:"prices"` + MaxTipAmount int `json:"max_tip_amount,omitempty"` + SuggestedTipAmounts []int `json:"suggested_tip_amounts,omitempty"` + StartParameter string `json:"start_parameter,omitempty"` + ProviderData string `json:"provider_data,omitempty"` + PhotoURL string `json:"photo_url,omitempty"` + PhotoSize int `json:"photo_size,omitempty"` + PhotoWidth int `json:"photo_width,omitempty"` + PhotoHeight int `json:"photo_height,omitempty"` + NeedName bool `json:"need_name,omitempty"` + NeedPhoneNumber bool `json:"need_phone_number,omitempty"` + NeedEmail bool `json:"need_email,omitempty"` + NeedShippingAddress bool `json:"need_shipping_address,omitempty"` + SendPhoneNumberToProvider bool `json:"send_phone_number_to_provider,omitempty"` + SendEmailToProvider bool `json:"send_email_to_provider,omitempty"` + IsFlexible bool `json:"is_flexible,omitempty"` + DisableNotification bool `json:"disable_notification,omitempty"` + ProtectContent bool `json:"protect_content,omitempty"` + AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"` + MessageEffectID string `json:"message_effect_id,omitempty"` + SuggestedPostParameters *models.SuggestedPostParameters `json:"suggested_post_parameters,omitempty"` + ReplyParameters *models.ReplyParameters `json:"reply_parameters,omitempty"` + ReplyMarkup models.ReplyMarkup `json:"reply_markup,omitempty"` } type CreateInvoiceLinkParams struct { diff --git a/models/chat.go b/models/chat.go index f84569e..755241e 100644 --- a/models/chat.go +++ b/models/chat.go @@ -33,21 +33,22 @@ type ChatInviteLink struct { // ChatAdministratorRights https://core.telegram.org/bots/api#chatadministratorrights type ChatAdministratorRights struct { - IsAnonymous bool `json:"is_anonymous"` - CanManageChat bool `json:"can_manage_chat"` - CanDeleteMessages bool `json:"can_delete_messages"` - CanManageVideoChats bool `json:"can_manage_video_chats"` - CanRestrictMembers bool `json:"can_restrict_members"` - CanPromoteMembers bool `json:"can_promote_members"` - CanChangeInfo bool `json:"can_change_info"` - CanInviteUsers bool `json:"can_invite_users"` - CanPostMessages bool `json:"can_post_messages,omitempty"` - CanEditMessages bool `json:"can_edit_messages,omitempty"` - CanPinMessages bool `json:"can_pin_messages,omitempty"` - CanPostStories bool `json:"can_post_stories,omitempty"` - CanEditStories bool `json:"can_edit_stories,omitempty"` - CanDeleteStories bool `json:"can_delete_stories,omitempty"` - CanManageTopics bool `json:"can_manage_topics,omitempty"` + IsAnonymous bool `json:"is_anonymous"` + CanManageChat bool `json:"can_manage_chat"` + CanDeleteMessages bool `json:"can_delete_messages"` + CanManageVideoChats bool `json:"can_manage_video_chats"` + CanRestrictMembers bool `json:"can_restrict_members"` + CanPromoteMembers bool `json:"can_promote_members"` + CanChangeInfo bool `json:"can_change_info"` + CanInviteUsers bool `json:"can_invite_users"` + CanPostMessages bool `json:"can_post_messages,omitempty"` + CanEditMessages bool `json:"can_edit_messages,omitempty"` + CanPinMessages bool `json:"can_pin_messages,omitempty"` + CanPostStories bool `json:"can_post_stories,omitempty"` + CanEditStories bool `json:"can_edit_stories,omitempty"` + CanDeleteStories bool `json:"can_delete_stories,omitempty"` + CanManageTopics bool `json:"can_manage_topics,omitempty"` + CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"` } // ChatPermissions https://core.telegram.org/bots/api#chatpermissions @@ -91,13 +92,14 @@ const ( // Chat https://core.telegram.org/bots/api#chat type Chat struct { - ID int64 `json:"id"` - Type ChatType `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"` + ID int64 `json:"id"` + Type ChatType `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"` + IsDirectMessages bool `json:"is_direct_messages,omitempty"` } // ChatFullInfo https://core.telegram.org/bots/api#chatfullinfo @@ -109,6 +111,7 @@ type ChatFullInfo struct { FirstName string `json:"first_name,omitempty"` LastName string `json:"last_name,omitempty"` IsForum bool `json:"is_forum,omitempty"` + IsDirectMessages bool `json:"is_direct_messages,omitempty"` Photo *ChatPhoto `json:"photo,omitempty"` ActiveUsernames []string `json:"active_usernames,omitempty"` Birthdate Birthdate `json:"birthdate,omitempty"` @@ -116,6 +119,7 @@ type ChatFullInfo struct { BusinessLocation *BusinessLocation `json:"business_location,omitempty"` BusinessOpeningHours *BusinessOpeningHours `json:"business_opening_hours,omitempty"` PersonalChat *Chat `json:"personal_chat,omitempty"` + ParentChat *Chat `json:"parent_chat,omitempty"` AvailableReactions []ReactionType `json:"available_reactions,omitempty"` AccentColorID int `json:"accent_color_id,omitempty"` MaxReactionCount int `json:"max_reaction_count"` diff --git a/models/chat_member.go b/models/chat_member.go index 1721ae0..264f5cf 100644 --- a/models/chat_member.go +++ b/models/chat_member.go @@ -113,25 +113,26 @@ type ChatMemberOwner struct { // ChatMemberAdministrator https://core.telegram.org/bots/api#chatmemberadministrator type ChatMemberAdministrator struct { - Status ChatMemberType `json:"status"` // The member's status in the chat, always “administrator” - User User `json:"user"` - CanBeEdited bool `json:"can_be_edited"` - IsAnonymous bool `json:"is_anonymous"` - CanManageChat bool `json:"can_manage_chat"` - CanDeleteMessages bool `json:"can_delete_messages"` - CanManageVideoChats bool `json:"can_manage_video_chats"` - CanRestrictMembers bool `json:"can_restrict_members"` - CanPromoteMembers bool `json:"can_promote_members"` - CanChangeInfo bool `json:"can_change_info"` - CanInviteUsers bool `json:"can_invite_users"` - CanPostMessages bool `json:"can_post_messages,omitempty"` - CanEditMessages bool `json:"can_edit_messages,omitempty"` - CanPinMessages bool `json:"can_pin_messages,omitempty"` - CanPostStories bool `json:"can_post_stories,omitempty"` - CanEditStories bool `json:"can_edit_stories,omitempty"` - CanDeleteStories bool `json:"can_delete_stories,omitempty"` - CanManageTopics bool `json:"can_manage_topics,omitempty"` - CustomTitle string `json:"custom_title,omitempty"` + Status ChatMemberType `json:"status"` // The member's status in the chat, always “administrator” + User User `json:"user"` + CanBeEdited bool `json:"can_be_edited"` + IsAnonymous bool `json:"is_anonymous"` + CanManageChat bool `json:"can_manage_chat"` + CanDeleteMessages bool `json:"can_delete_messages"` + CanManageVideoChats bool `json:"can_manage_video_chats"` + CanRestrictMembers bool `json:"can_restrict_members"` + CanPromoteMembers bool `json:"can_promote_members"` + CanChangeInfo bool `json:"can_change_info"` + CanInviteUsers bool `json:"can_invite_users"` + CanPostMessages bool `json:"can_post_messages,omitempty"` + CanEditMessages bool `json:"can_edit_messages,omitempty"` + CanPinMessages bool `json:"can_pin_messages,omitempty"` + CanPostStories bool `json:"can_post_stories,omitempty"` + CanEditStories bool `json:"can_edit_stories,omitempty"` + CanDeleteStories bool `json:"can_delete_stories,omitempty"` + CanManageTopics bool `json:"can_manage_topics,omitempty"` + CanManageDirectMessages bool `json:"can_manage_direct_messages,omitempty"` + CustomTitle string `json:"custom_title,omitempty"` } // ChatMemberMember https://core.telegram.org/bots/api#chatmembermember diff --git a/models/gift.go b/models/gift.go index 6894118..55f79eb 100644 --- a/models/gift.go +++ b/models/gift.go @@ -18,6 +18,7 @@ type Gift struct { UpgradeStarCount int `json:"upgrade_star_count,omitempty"` TotalCount int `json:"total_count,omitempty"` RemainingCount int `json:"remaining_count,omitempty"` + PublisherChat *Chat `json:"publisher_chat,omitempty"` } // AcceptedGiftTypes https://core.telegram.org/bots/api#acceptedgifttypes @@ -103,12 +104,13 @@ type OwnedGifts struct { // UniqueGift https://core.telegram.org/bots/api#uniquegift type UniqueGift struct { - BaseName string `json:"base_name"` - Name string `json:"name"` - Number int `json:"number"` - Model UniqueGiftModel `json:"model"` - Symbol UniqueGiftSymbol `json:"symbol"` - Backdrop UniqueGiftBackdrop `json:"backdrop"` + BaseName string `json:"base_name"` + Name string `json:"name"` + Number int `json:"number"` + Model UniqueGiftModel `json:"model"` + Symbol UniqueGiftSymbol `json:"symbol"` + Backdrop UniqueGiftBackdrop `json:"backdrop"` + PublisherChat *Chat `json:"publisher_chat,omitempty"` } // UniqueGiftModel https://core.telegram.org/bots/api#uniquegiftmodel diff --git a/models/message.go b/models/message.go index b5b45bf..3dd138c 100644 --- a/models/message.go +++ b/models/message.go @@ -72,6 +72,7 @@ type MessageAutoDeleteTimerChanged struct { type Message struct { ID int `json:"message_id"` MessageThreadID int `json:"message_thread_id,omitempty"` + DirectMessagesTopic *DirectMessagesTopic `json:"direct_messages_topic,omitempty"` From *User `json:"from,omitempty"` SenderChat *Chat `json:"sender_chat,omitempty"` SenderBoostCount int `json:"sender_boost_count,omitempty"` @@ -86,16 +87,19 @@ type Message struct { ExternalReply *ExternalReplyInfo `json:"external_reply,omitempty"` Quote *TextQuote `json:"quote,omitempty"` ReplyToStore *Story `json:"reply_to_store,omitempty"` + ReplyToChecklistTaskID int `json:"reply_to_checklist_task_id,omitempty"` 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"` + IsPaidPost bool `json:"is_paid_post,omitempty"` MediaGroupID string `json:"media_group_id,omitempty"` AuthorSignature string `json:"author_signature,omitempty"` PaidStarCount int `json:"paid_star_count,omitempty"` Text string `json:"text,omitempty"` Entities []MessageEntity `json:"entities,omitempty"` LinkPreviewOptions *LinkPreviewOptions `json:"link_preview_options,omitempty"` + SuggestedPostInfo *SuggestedPostInfo `json:"suggested_post_info,omitempty"` EffectID string `json:"effect_id,omitempty"` Animation *Animation `json:"animation,omitempty"` Audio *Audio `json:"audio,omitempty"` @@ -157,6 +161,11 @@ type Message struct { GiveawayWinners *GiveawayWinners `json:"giveaway_winners,omitempty"` GiveawayCompleted *GiveawayCompleted `json:"giveaway_completed,omitempty"` PaidMessagePriceChanged *PaidMessagePriceChanged `json:"paid_message_price_changed,omitempty"` + SuggestedPostApproved *SuggestedPostApproved `json:"suggested_post_approved,omitempty"` + SuggestedPostApprovalFailed *SuggestedPostApprovalFailed `json:"suggested_post_approval_failed,omitempty"` + SuggestedPostDeclined *SuggestedPostDeclined `json:"suggested_post_declined,omitempty"` + SuggestedPostPaid *SuggestedPostPaid `json:"suggested_post_paid,omitempty"` + SuggestedPostRefunded *SuggestedPostRefunded `json:"suggested_post_refunded,omitempty"` VoiceChatScheduled *VoiceChatScheduled `json:"voice_chat_scheduled,omitempty"` VoiceChatStarted *VoiceChatStarted `json:"voice_chat_started,omitempty"` VoiceChatEnded *VoiceChatEnded `json:"voice_chat_ended,omitempty"` @@ -170,3 +179,9 @@ type PreparedInlineMessage struct { ID string `json:"id"` ExpirationDate int `json:"expiration_date"` } + +// DirectMessagesTopic https://core.telegram.org/bots/api#directmessagestopic +type DirectMessagesTopic struct { + TopicID int `json:"topic_id"` + User *User `json:"user,omitempty"` +} diff --git a/models/reply.go b/models/reply.go index b50e87e..5eb14bb 100644 --- a/models/reply.go +++ b/models/reply.go @@ -51,6 +51,7 @@ type ReplyParameters struct { QuoteParseMode ParseMode `json:"quote_parse_mode,omitempty"` QuoteEntities []MessageEntity `json:"quote_entities,omitempty"` QuotePosition int `json:"quote_position,omitempty"` + ChecklistTaskID int `json:"checklist_task_id,omitempty"` } // MessageOriginType https://core.telegram.org/bots/api#messageorigin diff --git a/models/suggested_post.go b/models/suggested_post.go new file mode 100644 index 0000000..58d6bbd --- /dev/null +++ b/models/suggested_post.go @@ -0,0 +1,53 @@ +package models + +// SuggestedPostParameters https://core.telegram.org/bots/api#suggestedpostparameters +type SuggestedPostParameters struct { + Price *SuggestedPostPrice `json:"price,omitempty"` + SendDate int `json:"send_date,omitempty"` +} + +// SuggestedPostPrice https://core.telegram.org/bots/api#suggestedpostprice +type SuggestedPostPrice struct { + Currency string `json:"currency"` + Amount int `json:"amount"` +} + +// SuggestedPostInfo https://core.telegram.org/bots/api#suggestedpostinfo +type SuggestedPostInfo struct { + State string `json:"state"` + Price *SuggestedPostPrice `json:"price,omitempty"` + SendDate int `json:"send_date,omitempty"` +} + +// SuggestedPostApproved https://core.telegram.org/bots/api#suggestedpostapproved +type SuggestedPostApproved struct { + SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` + Price *SuggestedPostPrice `json:"price,omitempty"` + SendDate int `json:"send_date,omitempty"` +} + +// SuggestedPostApprovalFailed https://core.telegram.org/bots/api#suggestedpostapprovalfailed +type SuggestedPostApprovalFailed struct { + SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` + Price *SuggestedPostPrice `json:"price,omitempty"` +} + +// SuggestedPostDeclined https://core.telegram.org/bots/api#suggestedpostdeclined +type SuggestedPostDeclined struct { + SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` + Comment string `json:"comment,omitempty"` +} + +// SuggestedPostPaid https://core.telegram.org/bots/api#suggestedpostpaid +type SuggestedPostPaid struct { + SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` + Currency string `json:"currency"` + Amount int `json:"amount,omitempty"` + StarAmount *StarAmount `json:"star_amount,omitempty"` +} + +// SuggestedPostRefunded https://core.telegram.org/bots/api#suggestedpostrefunded +type SuggestedPostRefunded struct { + SuggestedPostMessage *Message `json:"suggested_post_message,omitempty"` + Reason string `json:"reason"` +}