From 7092cefe655def68e5a4b009f03270f7b9f2bbe5 Mon Sep 17 00:00:00 2001 From: Syfaro Date: Sat, 19 Sep 2015 13:42:50 -0500 Subject: [PATCH] add missing const --- methods.go | 2 ++ types.go | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/methods.go b/methods.go index 819509f..c464541 100644 --- a/methods.go +++ b/methods.go @@ -19,6 +19,8 @@ import ( const ( // APIEndpoint is the endpoint for all API methods, with formatting for Sprintf APIEndpoint = "https://api.telegram.org/bot%s/%s" + // FileEndpoint is the endpoint for downloading a file from Telegram + FileEndpoint = "https://api.telegram.org/file/bot%s/%s" ) // Constant values for ChatActions diff --git a/types.go b/types.go index 0983fa4..626cddd 100644 --- a/types.go +++ b/types.go @@ -183,7 +183,7 @@ type File struct { // // It requires the Bot Token to create the link. func (f *File) Link(token string) string { - return fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", token, f.FilePath) + return fmt.Sprintf(FileEndpoint, token, f.FilePath) } // ReplyKeyboardMarkup allows the Bot to set a custom keyboard.