Add sub events, document available event types

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-05-12 17:47:03 +02:00
parent 5941b50202
commit df31769142
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
4 changed files with 15 additions and 5 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
config
config.yaml config.yaml
.env .env
storage.json.gz storage.json.gz

View file

@ -8,4 +8,6 @@ var (
eventTypePermit = ptrStr("permit") eventTypePermit = ptrStr("permit")
eventTypeRaid = ptrStr("raid") eventTypeRaid = ptrStr("raid")
eventTypeResub = ptrStr("resub") eventTypeResub = ptrStr("resub")
eventTypeSub = ptrStr("sub")
eventTypeSubgift = ptrStr("subgift")
) )

6
irc.go
View file

@ -229,6 +229,12 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
case "resub": case "resub":
go handleMessage(i.c, m, eventTypeResub) go handleMessage(i.c, m, eventTypeResub)
case "sub":
go handleMessage(i.c, m, eventTypeSub)
case "subgift", "anonsubgift":
go handleMessage(i.c, m, eventTypeSubgift)
} }
} }

View file

@ -76,6 +76,7 @@ rules: # See below for examples
match_users: ['mychannel'] # List of users, all names MUST be all lower-case match_users: ['mychannel'] # List of users, all names MUST be all lower-case
# Execute actions when this event occurs # Execute actions when this event occurs
# Available events: join, host, permit, raid, resub, sub, subgift
match_event: 'permit' match_event: 'permit'
# Execute action when the chat message matches this regular expression # Execute action when the chat message matches this regular expression