fix: compatibility between tdlib and bot api style chatID

This commit is contained in:
krau
2025-12-04 22:43:22 +08:00
parent 37e9c79ceb
commit 685047e463
10 changed files with 206 additions and 140 deletions

View File

@@ -1,13 +0,0 @@
package tfile
import (
"github.com/gotd/td/telegram/downloader"
"github.com/krau/SaveAny-Bot/common/utils/dlutil"
"github.com/krau/SaveAny-Bot/config"
"github.com/krau/SaveAny-Bot/pkg/consts/tglimit"
)
func NewDownloader(file TGFile) *downloader.Builder {
return downloader.NewDownloader().WithPartSize(tglimit.MaxPartSize).
Download(file.Dler(), file.Location()).WithThreads(dlutil.BestThreads(file.Size(), config.C().Threads))
}