replace math.Floor with math.Ceil

it's better to notify user at 18:00, not 17:59
This commit is contained in:
Akulij 2025-03-29 19:22:57 +08:00
parent ed99f4a16f
commit 5923f6bf3f

View File

@ -83,7 +83,7 @@ func notifyAboutEvents(bc BotController) {
events, _ := bc.GetAllEvents()
for _, event := range events {
delta := event.Date.Sub(time.Now())
if int(math.Floor(delta.Minutes())) == 8*60 { // 8 hours
if int(math.Ceil(delta.Minutes())) == 8*60 { // 8 hours
reservations, _ := bc.GetReservationsByEventID(event.ID)
for _, reservation := range reservations {
uid := reservation.UserID