new
This commit is contained in:
parent
fef2ec79b8
commit
573f8fff0a
2 changed files with 12 additions and 7 deletions
9
main.go
9
main.go
|
|
@ -12,6 +12,7 @@ import (
|
|||
"sort"
|
||||
"syscall"
|
||||
"time"
|
||||
|
||||
Untis "untislogger/Untis"
|
||||
|
||||
BotStart "untislogger/Botrun"
|
||||
|
|
@ -68,6 +69,7 @@ func main() {
|
|||
<-sigChan
|
||||
log.Println("Shutting down...")
|
||||
}
|
||||
|
||||
func scheduleTimetableUpdate() {
|
||||
prevData := make(map[string][]byte)
|
||||
|
||||
|
|
@ -219,6 +221,7 @@ func NextRoomForTime(roomByStartTime map[string]string, current string) (string,
|
|||
}
|
||||
return "", "", false
|
||||
}
|
||||
|
||||
func NextSubjectForTime(subjectByStartTime map[string]string, current string) (string, bool) {
|
||||
layout := "15:04"
|
||||
now, err := time.Parse(layout, current)
|
||||
|
|
@ -243,8 +246,8 @@ func NextSubjectForTime(subjectByStartTime map[string]string, current string) (s
|
|||
}
|
||||
return "", false
|
||||
}
|
||||
func NextCodeForTime(codeByStartTime map[string]string, current string) (string, bool) {
|
||||
|
||||
func NextCodeForTime(codeByStartTime map[string]string, current string) (string, bool) {
|
||||
layout := "15:04"
|
||||
now, err := time.Parse(layout, current)
|
||||
if err != nil {
|
||||
|
|
@ -267,8 +270,8 @@ func NextCodeForTime(codeByStartTime map[string]string, current string) (string,
|
|||
}
|
||||
}
|
||||
return "", false
|
||||
|
||||
}
|
||||
|
||||
func MapTimeToRoom(path string) (map[string]string, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
|
|
@ -287,6 +290,7 @@ func MapTimeToRoom(path string) (map[string]string, error) {
|
|||
}
|
||||
return roomByStartTime, nil
|
||||
}
|
||||
|
||||
func MapTimeToCode(path string) (map[string]string, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
|
|
@ -307,6 +311,7 @@ func MapTimeToCode(path string) (map[string]string, error) {
|
|||
}
|
||||
return codeByStartTime, nil
|
||||
}
|
||||
|
||||
func MapTimeToSubject(path string) (map[string]string, error) {
|
||||
data, err := os.ReadFile(path)
|
||||
if err != nil {
|
||||
|
|
|
|||
BIN
untislogger
BIN
untislogger
Binary file not shown.
Loading…
Reference in a new issue