|
|
|
@ -31,7 +31,7 @@ type File struct {
|
|
|
|
|
// so upon uploading media you'll need to set embedded File
|
|
|
|
|
// with something. NewFile() returning File makes it a one-liner.
|
|
|
|
|
//
|
|
|
|
|
// photo := &tb.Photo{File: tb.FromDisk("chicken.jpg")}
|
|
|
|
|
// photo := &tb.Photo{File: tb.FromDisk("chicken.jpg")}
|
|
|
|
|
//
|
|
|
|
|
func FromDisk(filename string) File {
|
|
|
|
|
return File{FileLocal: filename}
|
|
|
|
@ -44,7 +44,7 @@ func FromDisk(filename string) File {
|
|
|
|
|
// so upon uploading media you'll need to set embedded File
|
|
|
|
|
// with something. NewFile() returning File makes it a one-liner.
|
|
|
|
|
//
|
|
|
|
|
// photo := &tb.Photo{File: tb.FromURL("https://site.com/picture.jpg")}
|
|
|
|
|
// photo := &tb.Photo{File: tb.FromURL("https://site.com/picture.jpg")}
|
|
|
|
|
//
|
|
|
|
|
func FromURL(url string) File {
|
|
|
|
|
return File{FileURL: url}
|
|
|
|
@ -57,7 +57,7 @@ func FromURL(url string) File {
|
|
|
|
|
// so upon uploading media you'll need to set embedded File
|
|
|
|
|
// with something. NewFile() returning File makes it a one-liner.
|
|
|
|
|
//
|
|
|
|
|
// photo := &tb.Photo{File: tb.FromReader(bytes.NewReader(...))}
|
|
|
|
|
// photo := &tb.Photo{File: tb.FromReader(bytes.NewReader(...))}
|
|
|
|
|
//
|
|
|
|
|
func FromReader(reader io.Reader) File {
|
|
|
|
|
return File{FileReader: reader}
|
|
|
|
|