Skip to content

Commit 7092cef

Browse files
author
Syfaro
committed
add missing const
1 parent 1bbe8c7 commit 7092cef

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

methods.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ import (
1919
const (
2020
// APIEndpoint is the endpoint for all API methods, with formatting for Sprintf
2121
APIEndpoint = "https://api.telegram.org/bot%s/%s"
22+
// FileEndpoint is the endpoint for downloading a file from Telegram
23+
FileEndpoint = "https://api.telegram.org/file/bot%s/%s"
2224
)
2325

2426
// Constant values for ChatActions

types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ type File struct {
183183
//
184184
// It requires the Bot Token to create the link.
185185
func (f *File) Link(token string) string {
186-
return fmt.Sprintf("https://api.telegram.org/file/bot%s/%s", token, f.FilePath)
186+
return fmt.Sprintf(FileEndpoint, token, f.FilePath)
187187
}
188188

189189
// ReplyKeyboardMarkup allows the Bot to set a custom keyboard.

0 commit comments

Comments
 (0)