fix: issues
This commit is contained in:
@@ -222,6 +222,7 @@ func (t *TClient) saveDocument(ctx context.Context, cfg *DBChannel, doc *tg.Docu
|
|||||||
|
|
||||||
saveTo := cfg.Asset(doc.GetID(), ext)
|
saveTo := cfg.Asset(doc.GetID(), ext)
|
||||||
downloader := downloader.NewDownloader()
|
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)
|
_, err := downloader.Download(t.Client.API(), location).ToPath(ctx, saveTo)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
os.Remove(saveTo)
|
os.Remove(saveTo)
|
||||||
|
|||||||
Reference in New Issue
Block a user