mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
[core] log bits from chat message
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
653d952e79
commit
250a07f5b8
1 changed files with 9 additions and 3 deletions
12
irc.go
12
irc.go
|
@ -331,9 +331,15 @@ func (i ircHandler) handleTwitchPrivmsg(m *irc.Message) {
|
|||
}
|
||||
|
||||
if bits, err := strconv.ParseInt(string(m.Tags["bits"]), 10, 64); err == nil {
|
||||
go handleMessage(i.c, m, eventTypeBits, plugins.FieldCollectionFromData(map[string]interface{}{
|
||||
"bits": bits,
|
||||
}))
|
||||
fields := plugins.FieldCollectionFromData(map[string]interface{}{
|
||||
"bits": bits,
|
||||
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
||||
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
||||
})
|
||||
|
||||
log.WithFields(log.Fields(fields.Data())).Info("User spent bits in chat message")
|
||||
|
||||
go handleMessage(i.c, m, eventTypeBits, fields)
|
||||
}
|
||||
|
||||
go handleMessage(i.c, m, nil, nil)
|
||||
|
|
Loading…
Reference in a new issue