Temp timezone fix #11

Merged
Jannover5000r merged 22 commits from temp-timezoneFix into main 2026-08-23 00:02:29 +02:00
Showing only changes of commit 68d358e1e4 - Show all commits

View file

@ -72,7 +72,7 @@ func main() {
}
func isScheduledTime(now time.Time) bool {
scheduled := []string{"06:45", "07:35", "08:35", "09:25", "10:25", "11:15", "12:45", "13:25"}
scheduled := []string{"07:45", "08:35", "09:35", "10:25", "11:25", "12:15", "13:45", "14:25"}
current := now.Format("15:04")
for _, t := range scheduled {
if t == current {
@ -142,6 +142,7 @@ func scheduleTimetableUpdate() {
// Ticker for scheduled lesson notifications
startMinuteTicker(func() {
now := time.Now()
now = now.Add(-1 * time.Hour)
if isScheduledTime(now) {
log.Println("Scheduled time reached, running notifications...")
accounts, _ := BotStart.LoadAndDecryptAccounts()
@ -185,7 +186,9 @@ func Run(userID string) {
roomByStartTime, _ := MapTimeToRoom(timetableFile)
subjectByStartTime, _ := MapTimeToSubject(timetableFile)
now := time.Now().Format("15:04")
nowOld := time.Now()
nowOld = nowOld.Add(-1 * time.Hour)
now := nowOld.Format("15:04")
nextTime, room, foundRoom := NextRoomForTime(roomByStartTime, now)
if !foundRoom {
return // No upcoming lessons