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!
This commit is contained in:
Chris Sexton 2013-06-16 11:52:47 -04:00
parent 25fa58dab0
commit 276cc3e2fe
1 changed files with 3 additions and 1 deletions

View File

@ -151,6 +151,7 @@ func (p *BeersPlugin) Message(message bot.Message) bool {
u := untappdUser{ u := untappdUser{
UntappdUser: parts[1], UntappdUser: parts[1],
ChanNick: message.User.Name, ChanNick: message.User.Name,
Channel: message.Channel,
} }
p.getUntappdCheckins(u) p.getUntappdCheckins(u)
@ -263,6 +264,7 @@ type Beers struct {
type untappdUser struct { type untappdUser struct {
UntappdUser string UntappdUser string
Channel string
LastCheckin int LastCheckin int
ChanNick string ChanNick string
KnownCheckins [5]int KnownCheckins [5]int
@ -334,7 +336,7 @@ func (p *BeersPlugin) checkUntappd(channel string) {
time.Sleep(time.Duration(frequency) * time.Second) time.Sleep(time.Duration(frequency) * time.Second)
var users []untappdUser 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") log.Println("Found ", len(users), " untappd users")