diff --git a/events.go b/events.go index 08eed98..7482017 100644 --- a/events.go +++ b/events.go @@ -11,4 +11,5 @@ var ( eventTypeResub = ptrStr("resub") eventTypeSub = ptrStr("sub") eventTypeSubgift = ptrStr("subgift") + eventTypeWhisper = ptrStr("whisper") ) diff --git a/irc.go b/irc.go index 6b5cd13..969d2f7 100644 --- a/irc.go +++ b/irc.go @@ -122,6 +122,11 @@ func (i ircHandler) Handle(c *irc.Client, m *irc.Message) { // Announces Twitch-specific events to the channel (for example, a user’s 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{} diff --git a/wiki/Home.md b/wiki/Home.md index 62c236c..2ea33fe 100644 --- a/wiki/Home.md +++ b/wiki/Home.md @@ -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