Don't crash when receiving a Grok card

This commit is contained in:
Alessio 2024-07-28 08:07:33 -07:00
parent 98015ddf0c
commit d0c23b392b

View File

@ -5,6 +5,7 @@ import (
"net/url" "net/url"
"path" "path"
"regexp" "regexp"
"log"
) )
type Url struct { type Url struct {
@ -56,6 +57,9 @@ func ParseAPIUrlCard(apiCard APICard) Url {
thumbnail_url = values.Thumbnail.ImageValue.Url thumbnail_url = values.Thumbnail.ImageValue.Url
} else if apiCard.Name == "player" { } else if apiCard.Name == "player" {
thumbnail_url = values.PlayerImage.ImageValue.Url thumbnail_url = values.PlayerImage.ImageValue.Url
} else if apiCard.Name == "unified_card" {
// TODO: Grok chat previews
log.Print("Grok chat card, not implemented yet-- skipping")
} else { } else {
panic("Unknown card type: " + apiCard.Name) panic("Unknown card type: " + apiCard.Name)
} }