mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 20:01:17 +00:00
Fix: Do not send update when not asked to
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
43849052e1
commit
2eb12900b9
1 changed files with 32 additions and 34 deletions
|
@ -90,10 +90,7 @@ func (r *twitchWatcher) updateChannelFromAPI(channel string, sendUpdate bool) er
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.ChannelStatus[channel] == nil {
|
if sendUpdate && r.ChannelStatus[channel] != nil {
|
||||||
r.ChannelStatus[channel] = &status
|
|
||||||
}
|
|
||||||
|
|
||||||
if r.ChannelStatus[channel].Category != status.Category {
|
if r.ChannelStatus[channel].Category != status.Category {
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"channel": channel,
|
"channel": channel,
|
||||||
|
@ -127,6 +124,7 @@ func (r *twitchWatcher) updateChannelFromAPI(channel string, sendUpdate bool) er
|
||||||
|
|
||||||
go handleMessage(nil, nil, evt, nil)
|
go handleMessage(nil, nil, evt, nil)
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
r.ChannelStatus[channel] = &status
|
r.ChannelStatus[channel] = &status
|
||||||
return nil
|
return nil
|
||||||
|
|
Loading…
Reference in a new issue