From 5773141b1ccfe3953583de3d92e82baee3ecada2 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 23 Aug 2021 11:45:17 -0400 Subject: [PATCH] goals: send goal messages to the correct channel --- plugins/goals/goals.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/plugins/goals/goals.go b/plugins/goals/goals.go index 4120b3f..666be6d 100644 --- a/plugins/goals/goals.go +++ b/plugins/goals/goals.go @@ -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) - } else { - p.checkCompetition(c, ch, u.What, u.Who) - } + if g.Kind == "goal" { + p.checkGoal(c, r.Msg.Channel, u.What, u.Who) + } else { + p.checkCompetition(c, r.Msg.Channel, u.What, u.Who) } } }