Merge pull request #9 from jqs7/master

Updated to the last tgbot API
bot-api-6.1
Syfaro 2015-08-04 21:50:30 -04:00
commit 3c9ed7cfe2
2 changed files with 10 additions and 2 deletions

View File

@ -99,6 +99,8 @@ type StickerConfig struct {
// VideoConfig contains information about a SendVideo request. // VideoConfig contains information about a SendVideo request.
type VideoConfig struct { type VideoConfig struct {
ChatID int ChatID int
Duration int
Caption string
ReplyToMessageID int ReplyToMessageID int
ReplyMarkup interface{} ReplyMarkup interface{}
UseExistingVideo bool UseExistingVideo bool
@ -600,6 +602,12 @@ func (bot *BotAPI) SendVideo(config VideoConfig) (Message, error) {
if config.ReplyToMessageID != 0 { if config.ReplyToMessageID != 0 {
v.Add("reply_to_message_id", strconv.Itoa(config.ReplyToMessageID)) 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 { if config.ReplyMarkup != nil {
data, err := json.Marshal(config.ReplyMarkup) data, err := json.Marshal(config.ReplyMarkup)
if err != nil { if err != nil {

View File

@ -73,6 +73,7 @@ type Message struct {
Photo []PhotoSize `json:"photo"` Photo []PhotoSize `json:"photo"`
Sticker Sticker `json:"sticker"` Sticker Sticker `json:"sticker"`
Video Video `json:"video"` Video Video `json:"video"`
Caption string `json:"caption"`
Contact Contact `json:"contact"` Contact Contact `json:"contact"`
Location Location `json:"location"` Location Location `json:"location"`
NewChatParticipant User `json:"new_chat_participant"` NewChatParticipant User `json:"new_chat_participant"`
@ -136,7 +137,6 @@ type Video struct {
Thumbnail PhotoSize `json:"thumb"` Thumbnail PhotoSize `json:"thumb"`
MimeType string `json:"mime_type"` MimeType string `json:"mime_type"`
FileSize int `json:"file_size"` FileSize int `json:"file_size"`
Caption string `json:"caption"`
} }
// Contact contains information about a contact, such as PhoneNumber and UserId. // Contact contains information about a contact, such as PhoneNumber and UserId.
@ -144,7 +144,7 @@ type Contact struct {
PhoneNumber string `json:"phone_number"` PhoneNumber string `json:"phone_number"`
FirstName string `json:"first_name"` FirstName string `json:"first_name"`
LastName string `json:"last_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. // Location contains information about a place, such as Longitude and Latitude.