untappd: fix badge image to match json

This commit is contained in:
Chris Sexton 2019-09-28 13:45:53 -04:00
parent 267ec1a8bf
commit 3ba71cf9f6
1 changed files with 6 additions and 2 deletions

View File

@ -292,7 +292,11 @@ type checkin struct {
Items []struct { Items []struct {
BadgeName string `json:"badge_name"` BadgeName string `json:"badge_name"`
BadgeDescription string `json:"badge_description"` BadgeDescription string `json:"badge_description"`
BadgeImage string `json:"badge_image"` BadgeImage struct {
Sm string
Md string
Lg string
} `json:"badge_image"`
} }
} }
} }
@ -438,7 +442,7 @@ func (p *BeersPlugin) checkUntappd(c bot.Connector, channel string) {
if checkin.Badges.Count > 0 { if checkin.Badges.Count > 0 {
for _, b := range checkin.Badges.Items { for _, b := range checkin.Badges.Items {
args = append(args, bot.ImageAttachment{ args = append(args, bot.ImageAttachment{
URL: b.BadgeImage, URL: b.BadgeImage.Lg,
AltTxt: b.BadgeDescription, AltTxt: b.BadgeDescription,
}) })
} }