untappd: split badge between msg and images

This commit is contained in:
Chris Sexton 2019-09-28 13:18:23 -04:00
parent d974030b68
commit 267ec1a8bf
1 changed files with 6 additions and 2 deletions

View File

@ -415,6 +415,12 @@ func (p *BeersPlugin) checkUntappd(c bot.Connector, channel string) {
msg = fmt.Sprintf("%s -- %s", msg = fmt.Sprintf("%s -- %s",
msg, checkin.Checkin_comment) 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{}{ args := []interface{}{
channel, channel,
@ -430,9 +436,7 @@ func (p *BeersPlugin) checkUntappd(c bot.Connector, channel string) {
}) })
} }
if checkin.Badges.Count > 0 { if checkin.Badges.Count > 0 {
msg = msg + "\nThis checkin earned the following badge(s): "
for _, b := range checkin.Badges.Items { for _, b := range checkin.Badges.Items {
msg = msg + b.BadgeName
args = append(args, bot.ImageAttachment{ args = append(args, bot.ImageAttachment{
URL: b.BadgeImage, URL: b.BadgeImage,
AltTxt: b.BadgeDescription, AltTxt: b.BadgeDescription,