mirror of https://github.com/velour/catbase.git
Merge pull request #205 from velour/badges
untappd: switch text line for image descriptions
This commit is contained in:
commit
6ebc476456
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue