mirror of
https://github.com/Luzifer/twitch-bot.git
synced 2024-11-09 16:50:01 +00:00
[core] Fix: Notify event handlers before rules to prevent delays
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
967e301390
commit
40fb93962c
1 changed files with 5 additions and 5 deletions
10
actions.go
10
actions.go
|
@ -66,6 +66,11 @@ func triggerAction(c *irc.Client, m *irc.Message, rule *plugins.Rule, ra *plugin
|
||||||
}
|
}
|
||||||
|
|
||||||
func handleMessage(c *irc.Client, m *irc.Message, event *string, eventData *plugins.FieldCollection) {
|
func handleMessage(c *irc.Client, m *irc.Message, event *string, eventData *plugins.FieldCollection) {
|
||||||
|
// Send events to registered handlers
|
||||||
|
if event != nil {
|
||||||
|
go notifyEventHandlers(*event, eventData)
|
||||||
|
}
|
||||||
|
|
||||||
for _, r := range config.GetMatchingRules(m, event, eventData) {
|
for _, r := range config.GetMatchingRules(m, event, eventData) {
|
||||||
var preventCooldown bool
|
var preventCooldown bool
|
||||||
|
|
||||||
|
@ -83,9 +88,4 @@ func handleMessage(c *irc.Client, m *irc.Message, event *string, eventData *plug
|
||||||
r.SetCooldown(timerStore, m, eventData)
|
r.SetCooldown(timerStore, m, eventData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send events to registered handlers
|
|
||||||
if event != nil {
|
|
||||||
notifyEventHandlers(*event, eventData)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue