Add whisper event

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-05-26 14:38:15 +02:00
parent b09404cef6
commit 477f07c963
Signed by: luzifer
GPG Key ID: 0066F03ED215AD7D
3 changed files with 11 additions and 1 deletions

View File

@ -11,4 +11,5 @@ var (
eventTypeResub = ptrStr("resub")
eventTypeSub = ptrStr("sub")
eventTypeSubgift = ptrStr("subgift")
eventTypeWhisper = ptrStr("whisper")
)

9
irc.go
View File

@ -122,6 +122,11 @@ func (i ircHandler) Handle(c *irc.Client, m *irc.Message) {
// Announces Twitch-specific events to the channel (for example, a users subscription notification).
i.handleTwitchUsernotice(m)
case "WHISPER":
// WHISPER (Twitch Commands)
// Delivers whisper-messages received
i.handleTwitchWhisper(m)
default:
log.WithFields(log.Fields{
"command": m.Command,
@ -247,6 +252,10 @@ func (i ircHandler) handleTwitchUsernotice(m *irc.Message) {
}
}
func (i ircHandler) handleTwitchWhisper(m *irc.Message) {
go handleMessage(i.c, m, eventTypeWhisper)
}
func (ircHandler) ParseBadgeLevels(m *irc.Message) badgeCollection {
out := badgeCollection{}

View File

@ -96,7 +96,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, part, permit, raid, resub, sub, subgift
# Available events: join, host, part, permit, raid, resub, sub, subgift, whisper
match_event: 'permit'
# Execute action when the chat message matches this regular expression