mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-12-20 20:01:17 +00:00
Add whisper
event
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b09404cef6
commit
477f07c963
3 changed files with 11 additions and 1 deletions
|
@ -11,4 +11,5 @@ var (
|
||||||
eventTypeResub = ptrStr("resub")
|
eventTypeResub = ptrStr("resub")
|
||||||
eventTypeSub = ptrStr("sub")
|
eventTypeSub = ptrStr("sub")
|
||||||
eventTypeSubgift = ptrStr("subgift")
|
eventTypeSubgift = ptrStr("subgift")
|
||||||
|
eventTypeWhisper = ptrStr("whisper")
|
||||||
)
|
)
|
||||||
|
|
9
irc.go
9
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).
|
// Announces Twitch-specific events to the channel (for example, a user’s subscription notification).
|
||||||
i.handleTwitchUsernotice(m)
|
i.handleTwitchUsernotice(m)
|
||||||
|
|
||||||
|
case "WHISPER":
|
||||||
|
// WHISPER (Twitch Commands)
|
||||||
|
// Delivers whisper-messages received
|
||||||
|
i.handleTwitchWhisper(m)
|
||||||
|
|
||||||
default:
|
default:
|
||||||
log.WithFields(log.Fields{
|
log.WithFields(log.Fields{
|
||||||
"command": m.Command,
|
"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 {
|
func (ircHandler) ParseBadgeLevels(m *irc.Message) badgeCollection {
|
||||||
out := badgeCollection{}
|
out := badgeCollection{}
|
||||||
|
|
||||||
|
|
|
@ -96,7 +96,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, part, permit, raid, resub, sub, subgift
|
# Available events: join, host, part, permit, raid, resub, sub, subgift, whisper
|
||||||
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
|
||||||
|
|
Loading…
Reference in a new issue