Merge pull request #204 from velour/badges

untappd: fix badge image to match json
This commit is contained in:
Chris Sexton 2019-09-28 13:49:42 -04:00 committed by GitHub
commit 971b26670a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -292,7 +292,11 @@ type checkin struct {
Items []struct {
BadgeName string `json:"badge_name"`
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 {
for _, b := range checkin.Badges.Items {
args = append(args, bot.ImageAttachment{
URL: b.BadgeImage,
URL: b.BadgeImage.Lg,
AltTxt: b.BadgeDescription,
})
}