commit
3c9ed7cfe2
|
@ -99,6 +99,8 @@ type StickerConfig struct {
|
|||
// VideoConfig contains information about a SendVideo request.
|
||||
type VideoConfig struct {
|
||||
ChatID int
|
||||
Duration int
|
||||
Caption string
|
||||
ReplyToMessageID int
|
||||
ReplyMarkup interface{}
|
||||
UseExistingVideo bool
|
||||
|
@ -600,6 +602,12 @@ func (bot *BotAPI) SendVideo(config VideoConfig) (Message, error) {
|
|||
if config.ReplyToMessageID != 0 {
|
||||
v.Add("reply_to_message_id", strconv.Itoa(config.ReplyToMessageID))
|
||||
}
|
||||
if config.Duration != 0 {
|
||||
v.Add("duration", strconv.Itoa(config.Duration))
|
||||
}
|
||||
if config.Caption != "" {
|
||||
v.Add("caption", config.Caption)
|
||||
}
|
||||
if config.ReplyMarkup != nil {
|
||||
data, err := json.Marshal(config.ReplyMarkup)
|
||||
if err != nil {
|
||||
|
|
4
types.go
4
types.go
|
@ -73,6 +73,7 @@ type Message struct {
|
|||
Photo []PhotoSize `json:"photo"`
|
||||
Sticker Sticker `json:"sticker"`
|
||||
Video Video `json:"video"`
|
||||
Caption string `json:"caption"`
|
||||
Contact Contact `json:"contact"`
|
||||
Location Location `json:"location"`
|
||||
NewChatParticipant User `json:"new_chat_participant"`
|
||||
|
@ -136,7 +137,6 @@ type Video struct {
|
|||
Thumbnail PhotoSize `json:"thumb"`
|
||||
MimeType string `json:"mime_type"`
|
||||
FileSize int `json:"file_size"`
|
||||
Caption string `json:"caption"`
|
||||
}
|
||||
|
||||
// Contact contains information about a contact, such as PhoneNumber and UserId.
|
||||
|
@ -144,7 +144,7 @@ type Contact struct {
|
|||
PhoneNumber string `json:"phone_number"`
|
||||
FirstName string `json:"first_name"`
|
||||
LastName string `json:"last_name"`
|
||||
UserID string `json:"user_id"`
|
||||
UserID int `json:"user_id"`
|
||||
}
|
||||
|
||||
// Location contains information about a place, such as Longitude and Latitude.
|
||||
|
|
Loading…
Reference in New Issue