pkg/download -> pkg/media

Signed-off-by: Sumner Evans <sumner.evans@automattic.com>
This commit is contained in:
Sumner Evans
2024-07-02 12:04:09 -06:00
parent 0921168b91
commit 5d39fc8c5f
7 changed files with 133 additions and 103 deletions
+17
View File
@@ -0,0 +1,17 @@
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
}