fix: issues

This commit is contained in:
Rogee
2024-09-04 19:26:50 +08:00
parent 0b736ee74d
commit e2357c8eb2

View File

@@ -222,6 +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()))
_, err := downloader.Download(t.Client.API(), location).ToPath(ctx, saveTo)
if err != nil {
os.Remove(saveTo)