module Crirc::Binding::Handler
Overview
Register hooks to handle the behavior of a system based on a message.
Direct including types
Defined in:
crirc/binding/handler.crConstructors
Instance Method Summary
- #handle(msg : String)
-
#handle(msg : Crirc::Protocol::Message)
Handle one
Message
It goes through the registred hooks, select the one to trigger. - #hooks : Hash(HookTest, Array(Hook))
-
#on(command : String, source : HookRule = nil, arguments : HookRule = nil, message : HookRule = nil, &hook : Hook)
Register a hook on a command name (JOIN, PRIVMSG, ...) and other rules
Constructor Detail
Instance Method Detail
def handle(msg : Crirc::Protocol::Message)
#
Handle one Message
It goes through the registred hooks, select the one to trigger.
Then, it execute every hooks associated, and send as parameters the current message and the regex match if possible
TODO msg should NEVER be modified in the hook. (copy ? readonly ?)