From 6873dde3ab6252f1d31238d9e214d8dc77f8674b Mon Sep 17 00:00:00 2001 From: Gleb Sinyavsky Date: Sat, 21 Nov 2015 16:25:59 +0300 Subject: [PATCH] Bot getFileDirectUrl method added --- bot.go | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bot.go b/bot.go index 1b62cff..fb46136 100644 --- a/bot.go +++ b/bot.go @@ -169,6 +169,16 @@ func (bot *BotAPI) UploadFile(endpoint string, params map[string]string, fieldna 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. // // There are no parameters for this method.