birthdaybot/utils/utils.go
2023-07-10 23:09:25 +02:00

20 lines
351 B
Go

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
}