fix: size

This commit is contained in:
Rogee
2024-09-04 19:28:48 +08:00
parent e2357c8eb2
commit b00217b321

View File

@@ -222,7 +222,7 @@ func (t *TClient) saveDocument(ctx context.Context, cfg *DBChannel, doc *tg.Docu
saveTo := cfg.Asset(doc.GetID(), ext)
downloader := downloader.NewDownloader()
logger.Info("downloading document success", zap.String("location", saveTo), zap.String("mime", doc.GetMimeType()))
logger.Info("downloading document", zap.String("size", humanize.Bytes(uint64(doc.GetSize()))), zap.String("location", saveTo), zap.String("mime", doc.GetMimeType()))
_, err := downloader.Download(t.Client.API(), location).ToPath(ctx, saveTo)
if err != nil {
os.Remove(saveTo)