sarenji/pyrc — pull request #12 by wei2912 (2013-11-20 10:46:23+00:00)
Title: Compile regex on init (and add PRIVMSG hook)

Regular expressions should be compiled on init and not compiled every time they're required.

Due to a branching mistake, this pull request contains https://github.com/sarenji/pyrc/pull/10 , so just pull both.

Message of original pull request:

> This hook runs when a PRIVMSG is sent to a channel the bot is in or to the bot itself. It works almost exactly the same as a COMMAND except that it does not check for any prefix or nick highlighting.
> The test bot was updated to 1) show how hooks.privmsg can be used 2) show how to obtain parameters