mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-08 08:10:08 +00:00
Log changes in Twitch meta for events
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
dbca96a138
commit
a414a44190
1 changed files with 13 additions and 0 deletions
|
@ -91,18 +91,31 @@ func (r *twitchWatcher) updateChannelFromAPI(channel string, sendUpdate bool) er
|
|||
}
|
||||
|
||||
if r.ChannelStatus[channel].Category != status.Category {
|
||||
log.WithFields(log.Fields{
|
||||
"channel": channel,
|
||||
"category": status.Category,
|
||||
}).Debug("Twitch metadata changed")
|
||||
go handleMessage(nil, nil, eventTypeTwitchCategoryUpdate, map[string]interface{}{
|
||||
"category": status.Category,
|
||||
})
|
||||
}
|
||||
|
||||
if r.ChannelStatus[channel].Title != status.Title {
|
||||
log.WithFields(log.Fields{
|
||||
"channel": channel,
|
||||
"title": status.Title,
|
||||
}).Debug("Twitch metadata changed")
|
||||
go handleMessage(nil, nil, eventTypeTwitchTitleUpdate, map[string]interface{}{
|
||||
"title": status.Title,
|
||||
})
|
||||
}
|
||||
|
||||
if r.ChannelStatus[channel].IsLive != status.IsLive {
|
||||
log.WithFields(log.Fields{
|
||||
"channel": channel,
|
||||
"isLive": status.IsLive,
|
||||
}).Debug("Twitch metadata changed")
|
||||
|
||||
evt := eventTypeTwitchStreamOnline
|
||||
if !status.IsLive {
|
||||
evt = eventTypeTwitchStreamOffline
|
||||
|
|
Loading…
Reference in a new issue