func DownloadPhoto(link string) (*os.File, error) {
	var fileName string
	{
		u, err := url.Parse(link)
		if err != nil {
			return nil, err
		}
		fileName = u.Path[1:]
	}
	tmpFile, err := ioutil.TempFile("", "*."+fileName)
	if err != nil {
		return nil, err
	}
	err = downloadToFile(link, tmpFile)
	if err != nil {
		_ = os.Remove(tmpFile.Name())
		return nil, err
	}
	return tmpFile, nil
}
DownloadPhoto downloads a photo from reddit and returns the saved file in it
package reddit
import (
	"bytes"
	"errors"
	"github.com/HirbodBehnam/RedditDownloaderBot/config"
	"github.com/HirbodBehnam/RedditDownloaderBot/util"
	"io"
	"io/ioutil"
	"log"
	"net/http"
	"net/url"
	"os"
	"os/exec"
	"strings"
)
const maxDownloadSize = 50 * 1000 * 1000
var FileTooBigError = errors.New("file too big")