Lower nickname in Jeopardy cashout

Align with GetTarget() which is used in games to have consistent
handling of nicknames regardless of their casing.

Signed-off-by: Georg Pfuetzenreuter <mail@georg-pfuetzenreuter.net>
This commit is contained in:
Georg Pfuetzenreuter 2024-10-09 23:36:45 +02:00
parent c4ff70da70
commit 5ce4d4bfe4
Signed by: Georg
GPG Key ID: 1ED2F138E7E6FF57

View File

@ -102,7 +102,7 @@ func (w *WatIntegration) Jeopardy(m *irc.Message, msgargs []string) {
// host = we could use some WHO logic to find the host, but assuming nickname lookup to be sufficient here // host = we could use some WHO logic to find the host, but assuming nickname lookup to be sufficient here
// create = based on the above, maybe rather not create Watbot players based on only a nick? // create = based on the above, maybe rather not create Watbot players based on only a nick?
// but it expects someone to have played with Watbot before to be eligible for Jeopardy cashout .. // but it expects someone to have played with Watbot before to be eligible for Jeopardy cashout ..
player := w.db.User(name, "", false) player := w.db.User(strings.ToLower(name), "", false)
if player.Nick == "" { if player.Nick == "" {
fmt.Printf("Player %s does not exist in Watbot, skipping cashout.\n", name) fmt.Printf("Player %s does not exist in Watbot, skipping cashout.\n", name)
continue continue