We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1bceea1 commit 6b9324cCopy full SHA for 6b9324c
types.go
@@ -2,6 +2,7 @@ package tgbotapi
2
3
import (
4
"encoding/json"
5
+ "fmt"
6
"time"
7
)
8
@@ -178,6 +179,13 @@ type File struct {
178
179
FilePath string `json:"file_path"`
180
}
181
182
+// Link returns a full path to the download URL for a File.
183
+//
184
+// It requires the Bot Token to create the link.
185
+func (f *File) Link(token string) string {
186
+ return fmt.Sprintf(FileEndpoint, token, f.FilePath)
187
+}
188
+
189
// ReplyKeyboardMarkup allows the Bot to set a custom keyboard.
190
type ReplyKeyboardMarkup struct {
191
Keyboard [][]string `json:"keyboard"`
0 commit comments