birthdaybot/utils/utils.go

21 lines
351 B
Go
Raw Normal View History

package utils
import (
"os"
"path/filepath"
"git.ctrlz.es/mgdelacroix/birthdaybot/model"
)
func GetPictureForBirthday(birthday *model.Birthday, picturesDir string) (string, error) {
filename := birthday.Filename()
path := filepath.Join(picturesDir, filename)
_, err := os.Stat(path)
if err != nil {
return "", err
}
return path, nil
}