all repos — telegram-bot-api @ 3c9ed7cfe2f376ab7988c2eecb083dc4f5a2266b

Golang bindings for the Telegram Bot API

Merge pull request #9 from jqs7/master

Updated to the last tgbot API
Syfaro syfaro@foxpaw.in
Tue, 04 Aug 2015 21:50:30 -0400
commit

3c9ed7cfe2f376ab7988c2eecb083dc4f5a2266b

parent

752bd45f4c279b358afae7b359284e9dd834a3bd

2 files changed, 10 insertions(+), 2 deletions(-)

jump to
M methods.gomethods.go

@@ -99,6 +99,8 @@

// VideoConfig contains information about a SendVideo request. type VideoConfig struct { ChatID int + Duration int + Caption string ReplyToMessageID int ReplyMarkup interface{} UseExistingVideo bool

@@ -599,6 +601,12 @@ v.Add("chat_id", strconv.Itoa(config.ChatID))

v.Add("video", config.FileID) 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)
M types.gotypes.go

@@ -73,6 +73,7 @@ Document Document `json:"document"`

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 @@ Duration int `json:"duration"`

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.