5d39fc8c5f
Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
18 lines
446 B
Go
18 lines
446 B
Go
package media
|
|
|
|
import (
|
|
"context"
|
|
|
|
"github.com/gotd/td/telegram/downloader"
|
|
"github.com/gotd/td/tg"
|
|
)
|
|
|
|
func DownloadDocument(ctx context.Context, client downloader.Client, document *tg.Document) ([]byte, error) {
|
|
data, _, err := DownloadFileLocation(ctx, client, &tg.InputDocumentFileLocation{
|
|
ID: document.GetID(),
|
|
AccessHash: document.GetAccessHash(),
|
|
FileReference: document.GetFileReference(),
|
|
})
|
|
return data, err
|
|
}
|