mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-30 00:21:16 +00:00
[core] Add origin_id to subgift / submysterygift events
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
c950b2c38b
commit
ee92cbbb03
2 changed files with 9 additions and 5 deletions
12
irc.go
12
irc.go
|
@ -449,6 +449,7 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
|
||||||
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
||||||
"from": m.Tags["login"],
|
"from": m.Tags["login"],
|
||||||
"gifted_months": m.Tags["msg-param-gift-months"],
|
"gifted_months": m.Tags["msg-param-gift-months"],
|
||||||
|
"origin_id": m.Tags["msg-param-origin-id"],
|
||||||
"plan": m.Tags["msg-param-sub-plan"],
|
"plan": m.Tags["msg-param-sub-plan"],
|
||||||
"to": m.Tags["msg-param-recipient-user-name"],
|
"to": m.Tags["msg-param-recipient-user-name"],
|
||||||
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
||||||
|
@ -459,11 +460,12 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
|
||||||
|
|
||||||
case "submysterygift":
|
case "submysterygift":
|
||||||
evtData := plugins.FieldCollectionFromData(map[string]interface{}{
|
evtData := plugins.FieldCollectionFromData(map[string]interface{}{
|
||||||
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
"channel": i.getChannel(m), // Compatibility to plugins.DeriveChannel
|
||||||
"from": m.Tags["login"],
|
"from": m.Tags["login"],
|
||||||
"number": m.Tags["msg-param-mass-gift-count"],
|
"number": m.Tags["msg-param-mass-gift-count"],
|
||||||
"plan": m.Tags["msg-param-sub-plan"],
|
"origin_id": m.Tags["msg-param-origin-id"],
|
||||||
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
"plan": m.Tags["msg-param-sub-plan"],
|
||||||
|
"user": m.Tags["login"], // Compatibility to plugins.DeriveUser
|
||||||
})
|
})
|
||||||
log.WithFields(log.Fields(evtData.Data())).Info("User gifted subs to the community")
|
log.WithFields(log.Fields(evtData.Data())).Info("User gifted subs to the community")
|
||||||
|
|
||||||
|
|
|
@ -172,6 +172,7 @@ Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` - The channel the event occurred in
|
||||||
- `gifted_months` - Number of months the user gifted
|
- `gifted_months` - Number of months the user gifted
|
||||||
|
- `origin_id` - ID unique to the gift-event (can be used to match `subgift` events to corresponding `submysterygift` event)
|
||||||
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
||||||
- `to` - The user who received the sub
|
- `to` - The user who received the sub
|
||||||
- `username` - The login-name of the user who gifted the subscription
|
- `username` - The login-name of the user who gifted the subscription
|
||||||
|
@ -184,6 +185,7 @@ Fields:
|
||||||
|
|
||||||
- `channel` - The channel the event occurred in
|
- `channel` - The channel the event occurred in
|
||||||
- `number` - The amount of gifted subs
|
- `number` - The amount of gifted subs
|
||||||
|
- `origin_id` - ID unique to the gift-event (can be used to match `subgift` events to corresponding `submysterygift` event)
|
||||||
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
- `plan` - The sub-plan they are using (`1000` = T1, `2000` = T2, `3000` = T3, `Prime`)
|
||||||
- `username` - The login-name of the user who gifted the subscription
|
- `username` - The login-name of the user who gifted the subscription
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue