From 276cc3e2fed8b42b9eea37d918486201d4764ceb Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Sun, 16 Jun 2013 11:52:47 -0400 Subject: [PATCH] Fixes #8 This may have some bugs. It's a bit impossible to test as my only Untappd info is used up on the live bot. #YOLO! --- plugins/beers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugins/beers.go b/plugins/beers.go index e7ab4ce..39a868c 100644 --- a/plugins/beers.go +++ b/plugins/beers.go @@ -151,6 +151,7 @@ func (p *BeersPlugin) Message(message bot.Message) bool { u := untappdUser{ UntappdUser: parts[1], ChanNick: message.User.Name, + Channel: message.Channel, } p.getUntappdCheckins(u) @@ -263,6 +264,7 @@ type Beers struct { type untappdUser struct { UntappdUser string + Channel string LastCheckin int ChanNick string KnownCheckins [5]int @@ -334,7 +336,7 @@ func (p *BeersPlugin) checkUntappd(channel string) { time.Sleep(time.Duration(frequency) * time.Second) var users []untappdUser - p.Coll.Find(bson.M{"untappduser": bson.M{"$exists": true}}).All(&users) + p.Coll.Find(bson.M{"untappduser": bson.M{"$exists": true}, "channel": channel}).All(&users) log.Println("Found ", len(users), " untappd users")