diff options
| author | ilotterytea <iltsu@alright.party> | 2025-10-14 23:05:40 +0500 |
|---|---|---|
| committer | ilotterytea <iltsu@alright.party> | 2025-10-14 23:05:40 +0500 |
| commit | 5bea97d2e7e7ed0df9d5a3b3093c9e801730670e (patch) | |
| tree | 5b3a73d5f228d2d96eee13cab52df44bb48dbf13 /cmd/statsbot/main.go | |
| parent | 8b9188b2c0ac192150201c511944d68862275f69 (diff) | |
Diffstat (limited to 'cmd/statsbot/main.go')
| -rw-r--r-- | cmd/statsbot/main.go | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cmd/statsbot/main.go b/cmd/statsbot/main.go index 69fc7a5..d756684 100644 --- a/cmd/statsbot/main.go +++ b/cmd/statsbot/main.go @@ -2,6 +2,7 @@ package main import ( "log" + "slices" "github.com/gempir/go-twitch-irc" @@ -26,7 +27,13 @@ func main() { }) client.OnNewMessage(func(channel string, user twitch.User, message twitch.Message) { - go stats.HandleMessageEvent(channel, user, message, db) + i := slices.IndexFunc(channels, func(c stats.Channel) bool { + return c.Name() == channel + }) + + if i >= 0 { + go channels[i].HandleMessageEvent(user, message) + } }) go stats.JoinChannels(&channels, client, db) |
