untappd: switch text line for image descriptions

Checking out a reorder of the args too.
This commit is contained in:
Chris Sexton 2019-09-28 14:24:45 -04:00
parent 971b26670a
commit 631a0c2b0c
1 changed files with 8 additions and 14 deletions

View File

@ -419,17 +419,19 @@ 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,
msg, 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 checkin.Media.Count > 0 {
if strings.Contains(checkin.Media.Items[0].Photo.Photo_img_lg, "photos-processing") { if strings.Contains(checkin.Media.Items[0].Photo.Photo_img_lg, "photos-processing") {
continue continue
@ -439,14 +441,6 @@ func (p *BeersPlugin) checkUntappd(c bot.Connector, channel string) {
AltTxt: "Here's a photo", 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 user.lastCheckin = checkin.Checkin_id
_, err := p.db.Exec(`update untappd set _, err := p.db.Exec(`update untappd set