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
.env
storage.json.gz

View file

@ -3,9 +3,11 @@ package main
func ptrStr(s string) *string { return &s }
var (
eventTypeJoin = ptrStr("join")
eventTypeHost = ptrStr("host")
eventTypePermit = ptrStr("permit")
eventTypeRaid = ptrStr("raid")
eventTypeResub = ptrStr("resub")
eventTypeJoin = ptrStr("join")
eventTypeHost = ptrStr("host")
eventTypePermit = ptrStr("permit")
eventTypeRaid = ptrStr("raid")
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":
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
# Execute actions when this event occurs
# Available events: join, host, permit, raid, resub, sub, subgift
match_event: 'permit'
# Execute action when the chat message matches this regular expression