Bot getFileDirectUrl method added

bot-api-6.1
Gleb Sinyavsky 2015-11-21 16:25:59 +03:00
parent f8a3ac11b2
commit 6873dde3ab
1 changed files with 10 additions and 0 deletions

10
bot.go
View File

@ -169,6 +169,16 @@ func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldna
return apiResp, nil return apiResp, nil
} }
func (this *BotAPI) getFileDirectUrl(fileID string) (string, error) {
file, err := this.GetFile(FileConfig{fileID})
if err != nil {
return "", err
}
return file.Link(this.Token), nil
}
// GetMe fetches the currently authenticated bot. // GetMe fetches the currently authenticated bot.
// //
// There are no parameters for this method. // There are no parameters for this method.