fix: size
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user