247 lines
12 KiB
Go
247 lines
12 KiB
Go
package tgapi
|
|
|
|
type SendPhotoP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Photo string `json:"photo"`
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
|
|
|
|
ShowCaptionAboveMedia bool `json:"show_caption_above_media,omitempty"`
|
|
HasSpoiler bool `json:"has_spoiler,omitempty"`
|
|
DisableNotifications bool `json:"disable_notifications,omitempty"`
|
|
ProtectContent bool `json:"protect_content,omitempty"`
|
|
AllowPaidBroadcast bool `json:"allow_paid_broadcast,omitempty"`
|
|
MessageEffectID string `json:"message_effect_id,omitempty"`
|
|
|
|
SuggestedPostParameters *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendPhoto(params SendPhotoP) (Message, error) {
|
|
req := NewRequest[Message]("sendPhoto", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendAudioP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Audio string `json:"audio"`
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []MessageEntity `json:"caption_entities,omitempty"`
|
|
Duration int `json:"duration,omitempty"`
|
|
Performer string `json:"performer,omitempty"`
|
|
Title string `json:"title,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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendAudio(params SendAudioP) (Message, error) {
|
|
req := NewRequest[Message]("sendAudio", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendDocumentP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Document string `json:"document"`
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []MessageEntity `json:"caption_entities,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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendDocument(params SendDocumentP) (Message, error) {
|
|
req := NewRequest[Message]("sendDocument", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendVideoP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Video string `json:"video"`
|
|
Duration int `json:"duration,omitempty"`
|
|
Width int `json:"width,omitempty"`
|
|
Height int `json:"height,omitempty"`
|
|
Cover int `json:"cover,omitempty"`
|
|
|
|
StartTimestamp int `json:"start_timestamp,omitempty"`
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendVideo(params SendVideoP) (Message, error) {
|
|
req := NewRequest[Message]("sendVideo", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendAnimationP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Animation string `json:"animation"`
|
|
Duration int `json:"duration,omitempty"`
|
|
Width int `json:"width,omitempty"`
|
|
Height int `json:"height,omitempty"`
|
|
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendAnimation(params SendAnimationP) (Message, error) {
|
|
req := NewRequest[Message]("sendAnimation", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendVoiceP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Voice string `json:"voice"`
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendVoice(params *SendVoiceP) (Message, error) {
|
|
req := NewRequest[Message]("sendVoice", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendVideoNoteP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
VideoNote string `json:"video_note"`
|
|
Duration int `json:"duration,omitempty"`
|
|
Length int `json:"length,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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendVideoNote(params SendVideoNoteP) (Message, error) {
|
|
req := NewRequest[Message]("sendVideoNote", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendPaidMediaP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
StarCount int `json:"star_count,omitempty"`
|
|
|
|
Media []InputPaidMedia `json:"media"`
|
|
Payload string `json:"payload,omitempty"`
|
|
Caption string `json:"caption,omitempty"`
|
|
ParseMode ParseMode `json:"parse_mode,omitempty"`
|
|
CaptionEntities []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 *SuggestedPostParameters `json:"suggested_post_parameters,omitempty"`
|
|
ReplyParameters *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
ReplyMarkup *ReplyMarkup `json:"reply_markup,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendPaidMedia(params SendPaidMediaP) (Message, error) {
|
|
req := NewRequest[Message]("sendPaidMedia", params)
|
|
return req.Do(api)
|
|
}
|
|
|
|
type SendMediaGroupP struct {
|
|
BusinessConnectionID string `json:"business_connection_id,omitempty"`
|
|
ChatID int `json:"chat_id"`
|
|
MessageThreadID int `json:"message_thread_id,omitempty"`
|
|
DirectMessagesTopicID int `json:"direct_messages_topic_id,omitempty"`
|
|
|
|
Media []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 *ReplyParameters `json:"reply_parameters,omitempty"`
|
|
}
|
|
|
|
func (api *Api) SendMediaGroup(params SendMediaGroupP) (Message, error) {
|
|
req := NewRequest[Message]("sendMediaGroup", params)
|
|
return req.Do(api)
|
|
}
|