diff --git a/plugins/beers/beers.go b/plugins/beers/beers.go index 2644dc8..f821c9e 100644 --- a/plugins/beers/beers.go +++ b/plugins/beers/beers.go @@ -419,17 +419,19 @@ func (p *BeersPlugin) checkUntappd(c bot.Connector, channel string) { msg = fmt.Sprintf("%s -- %s", msg, checkin.Checkin_comment) } - if checkin.Badges.Count > 0 { - msg = msg + "\nThis checkin earned the following badge(s): " - for _, b := range checkin.Badges.Items { - msg = msg + b.BadgeName - } - } args := []interface{}{ channel, msg, } + if checkin.Badges.Count > 0 { + for _, b := range checkin.Badges.Items { + args = append(args, bot.ImageAttachment{ + URL: b.BadgeImage.Sm, + AltTxt: b.BadgeName, + }) + } + } if checkin.Media.Count > 0 { if strings.Contains(checkin.Media.Items[0].Photo.Photo_img_lg, "photos-processing") { continue @@ -439,14 +441,6 @@ func (p *BeersPlugin) checkUntappd(c bot.Connector, channel string) { AltTxt: "Here's a photo", }) } - if checkin.Badges.Count > 0 { - for _, b := range checkin.Badges.Items { - args = append(args, bot.ImageAttachment{ - URL: b.BadgeImage.Lg, - AltTxt: b.BadgeDescription, - }) - } - } user.lastCheckin = checkin.Checkin_id _, err := p.db.Exec(`update untappd set