mirror of https://github.com/velour/catbase.git
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!
This commit is contained in:
parent
25fa58dab0
commit
276cc3e2fe
|
@ -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")
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue