Fix typo, updates from vscode

This commit is contained in:
2023-12-02 15:59:05 -06:00
parent 349ef0b0e1
commit 5d47e8d03c
2 changed files with 7 additions and 5 deletions

11
main.go
View File

@ -5,9 +5,6 @@ import (
"errors"
"flag"
"fmt"
"github.com/goccy/go-json"
"github.com/joho/godotenv"
"github.com/valyala/fastjson"
"io"
"log"
"net/http"
@ -15,6 +12,10 @@ import (
"os"
"strconv"
"time"
"github.com/goccy/go-json"
"github.com/joho/godotenv"
"github.com/valyala/fastjson"
)
var (
@ -111,7 +112,7 @@ func main() {
}
}
if time.Now().Sub(time.Unix(lastRead, 0)) < time.Minute*15 {
if time.Since(time.Unix(lastRead, 0)) < time.Minute*15 {
fmt.Println("Too soon since the last request; doing nothing")
return
}
@ -181,7 +182,7 @@ func main() {
))
}
if day.Part2 != nil && lastMember.CompletionDayLevel[idx].Part2 == nil {
completionTime := time.Unix(day.Part1.GetStarTimestamp, 0).In(ChicagoTimeZone).Format("3:04:05pm")
completionTime := time.Unix(day.Part2.GetStarTimestamp, 0).In(ChicagoTimeZone).Format("3:04:05pm")
rank := getCompletionRank(&leaderboard, &member, idx, 2) + 1
ordinal := getOrdinal(rank)
sendNotification(fmt.Sprintf(