diff --git a/config/config.go b/config/config.go index 0b2a85a..3b312e2 100644 --- a/config/config.go +++ b/config/config.go @@ -3,10 +3,10 @@ package config var BotToken = "REDACTED" var CustomTeamNames = map[string]string{ - "UGA": "Georgia", - "Booger Eaters": "Auburn", - "Rape Enablers": "LSU", - "Checkerboard Clowns": "Tennessee", + "uga": "Georgia", + "booger eaters": "Auburn", + "rape enablers": "LSU", + "checkerboard clowns": "Tennessee", } func LoadConfig() { diff --git a/internal/clients/cfb/cfb.go b/internal/clients/cfb/cfb.go index 845d7f5..67e5b37 100644 --- a/internal/clients/cfb/cfb.go +++ b/internal/clients/cfb/cfb.go @@ -10,6 +10,7 @@ import ( "strings" "time" "unicode" + "discord-scores-bot/config" ) type Game struct { @@ -36,8 +37,14 @@ type Team struct { } func GetGameInfo(teamName string) string { - teamName = strings.TrimSpace(teamName) + teamName = strings.TrimSpace(strings.ToLower(teamName)) week := "" + + // Check if the teamName matches a custom name and replace if found + if customName, exists := config.CustomTeamNames[teamName]; exists { + log.Printf("Custom team name detected: %s -> %s", teamName, customName) + teamName = customName + } // Check if the last two characters of the input are integers for the week if len(teamName) >= 2 && unicode.IsDigit(rune(teamName[len(teamName)-1])) && unicode.IsDigit(rune(teamName[len(teamName)-2])) {