BotServ: TRIGGER — regex auto-responses
TRIGGER <#channel> ADD <regex>|<response> | DEL <num> | LIST | CLEAR: when a channel line matches <regex>, the assigned bot says <response> ($nick becomes the speaker's nick). Only the first matching trigger fires, and a line the bot just kicked for gets no response. Same engine machinery as badwords: patterns compile into one RegexSet per channel (linear-time, ReDoS-safe), cached and rebuilt only on a revision change. Patterns validated + size-limited at add time.
This commit is contained in:
parent
47b1fd351e
commit
929a4cdd92
6 changed files with 237 additions and 4 deletions
|
|
@ -139,6 +139,7 @@ fn to_wire(entry: &LogEntry) -> Option<ReplicationEvent> {
|
|||
| Event::ChannelSettingsSet { .. }
|
||||
| Event::ChannelKickerSet { .. }
|
||||
| Event::ChannelBadwordsSet { .. }
|
||||
| Event::ChannelTriggersSet { .. }
|
||||
| Event::ChannelTopicSet { .. }
|
||||
| Event::ChannelSuspended { .. }
|
||||
| Event::ChannelUnsuspended { .. }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue