diff --git a/README.md b/README.md index 1c59a9d..8b8e363 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,5 @@ +# Well, i guess this is not temporary anymore and will just become the new main + # Discord bot for logging Untis timetable to a Discord Webhook and Multiple accounts which can be added using !addaccount in a server whit the Bot ## create .env with Credentials diff --git a/Untis/Untis.go b/Untis/Untis.go index 51fe035..01f6324 100644 --- a/Untis/Untis.go +++ b/Untis/Untis.go @@ -7,7 +7,6 @@ import ( "log" "net/http" "os" - "time" "github.com/joho/godotenv" ) @@ -33,17 +32,6 @@ type LoginResponse struct { var Url = os.Getenv("URL") -var location *time.Location - -func init() { - godotenv.Load("../.env") - locEnv := os.Getenv("LOCATION_ENV") - if locEnv == "" { - locEnv = "UTC" - } - location, _ = time.LoadLocation(locEnv) -} - // var Password = os.Getenv("UNTIS_PASSWORD") // var USERS = os.Getenv("UNTIS_USER") func Main(user, password, userID string) { diff --git a/main.go b/main.go index 0fe0690..5b85c9e 100644 --- a/main.go +++ b/main.go @@ -104,7 +104,7 @@ func init() { locEnv := os.Getenv("LOCATION_ENV") var locerr error Untis.Location, locerr = time.LoadLocation(locEnv) - if err != nil { + if locerr != nil { log.Fatalf("Failed to load Timezone: %v", locerr) } }