[core] log bits from chat message

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-12-23 14:16:01 +01:00
parent 653d952e79
commit 250a07f5b8
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

12
irc.go
View file

@ -331,9 +331,15 @@ func (i ircHandler) handleTwitchPrivmsg(m *irc.Message) {
} }
if bits, err := strconv.ParseInt(string(m.Tags["bits"]), 10, 64); err == nil { if bits, err := strconv.ParseInt(string(m.Tags["bits"]), 10, 64); err == nil {
go handleMessage(i.c, m, eventTypeBits, plugins.FieldCollectionFromData(map[string]interface{}{ fields := plugins.FieldCollectionFromData(map[string]interface{}{
"bits": bits, "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) go handleMessage(i.c, m, nil, nil)