mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 11:51:17 +00:00
Add sub events, document available event types
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
5941b50202
commit
df31769142
4 changed files with 15 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,3 +1,4 @@
|
|||
config
|
||||
config.yaml
|
||||
.env
|
||||
storage.json.gz
|
||||
|
|
12
events.go
12
events.go
|
@ -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
6
irc.go
|
@ -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)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue