goals: send goal messages to the correct channel

This commit is contained in:
Chris Sexton 2021-08-23 11:45:17 -04:00 committed by Chris Sexton
parent d214fe0c45
commit 5773141b1c
1 changed files with 4 additions and 7 deletions

View File

@ -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)
return
}
chs := p.cfg.GetArray("channels", []string{})
c := p.b.DefaultConnector()
for _, g := range gs {
for _, ch := range chs {
if g.Kind == "goal" {
p.checkGoal(c, ch, u.What, u.Who)
p.checkGoal(c, r.Msg.Channel, u.What, u.Who)
} else {
p.checkCompetition(c, ch, u.What, u.Who)
}
p.checkCompetition(c, r.Msg.Channel, u.What, u.Who)
}
}
}