mirror of https://github.com/velour/catbase.git
goals: send goal messages to the correct channel
This commit is contained in:
parent
d214fe0c45
commit
5773141b1c
|
@ -322,15 +322,12 @@ func (p *GoalsPlugin) update(r bot.Request, u counter.Update) {
|
||||||
log.Error().Err(err).Msgf("could not get goal for %#v", u)
|
log.Error().Err(err).Msgf("could not get goal for %#v", u)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
chs := p.cfg.GetArray("channels", []string{})
|
|
||||||
c := p.b.DefaultConnector()
|
c := p.b.DefaultConnector()
|
||||||
for _, g := range gs {
|
for _, g := range gs {
|
||||||
for _, ch := range chs {
|
if g.Kind == "goal" {
|
||||||
if g.Kind == "goal" {
|
p.checkGoal(c, r.Msg.Channel, u.What, u.Who)
|
||||||
p.checkGoal(c, ch, u.What, u.Who)
|
} else {
|
||||||
} else {
|
p.checkCompetition(c, r.Msg.Channel, u.What, u.Who)
|
||||||
p.checkCompetition(c, ch, u.What, u.Who)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue