[core] Fix: Raid viewercount should be numeric, not string

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2022-02-10 00:22:18 +01:00
parent 6f16666940
commit 8cfd22c916
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D

3
irc.go
View file

@ -392,11 +392,12 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
go handleMessage(i.c, m, eventTypeGiftPaidUpgrade, evtData)
case "raid":
vc, _ := strconv.ParseInt(string(m.Tags["msg-param-viewerCount"]), 10, 64)
evtData := plugins.FieldCollectionFromData(map[string]interface{}{
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
"from": m.Tags["login"],
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
"viewercount": m.Tags["msg-param-viewerCount"],
"viewercount": vc,
})
log.WithFields(log.Fields(evtData.Data())).Info("Incoming raid")