From e5829899b06826c473fac5b288d3a38467ebfeb5 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Fri, 19 Jan 2018 14:20:22 -0500 Subject: [PATCH] beers: discard checkins with incomplete photos --- plugins/beers/beers.go | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/beers/beers.go b/plugins/beers/beers.go index 6d1b83e..f384e0a 100644 --- a/plugins/beers/beers.go +++ b/plugins/beers/beers.go @@ -420,9 +420,11 @@ func (p *BeersPlugin) checkUntappd(channel string) { msg, checkin.Checkin_comment) } - msg2 := "" if checkin.Media.Count > 0 { - msg2 = "Here's a photo: " + checkin.Media.Items[0].Photo.Photo_img_lg + if strings.Contains(checkin.Media.Items[0].Photo.Photo_img_lg, "photos-processing") { + continue + } + msg += "\nHere's a photo: " + checkin.Media.Items[0].Photo.Photo_img_lg } user.lastCheckin = checkin.Checkin_id @@ -435,9 +437,6 @@ func (p *BeersPlugin) checkUntappd(channel string) { log.Println("checkin id:", checkin.Checkin_id, "Message:", msg) p.Bot.SendMessage(channel, msg) - if msg2 != "" { - p.Bot.SendMessage(channel, msg2) - } } }