class Crirc::Binding::HookTest

Overview

The HookRules define a set of rules. Theses rules can test an event (message) to "match" with.

Defined in:

crirc/binding/hook_test.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(command : Regex | String = "PRIVMSG", source : Regex | String | Nil = nil, arguments : Regex | String | Nil = nil, message : Regex | String | Nil = nil) #
  • "command" is by default "PRIVMSG", and must be a UPPERCASE irc command (JOIN, PRIVMSG, ...)
  • "source" is optional. It represents the sender.
  • "arguments" is optional. It represents the parameters (without the last argument if prefixed with ":", like in JOIN).
  • "message" is optional. It represents the last argument when prefixed with ":".

[View source]

Instance Method Detail

def arguments : Regex | String | Nil #

[View source]
def command : Regex | String #

[View source]
def message : Regex | String | Nil #

[View source]
def raw_arguments : Regex | String | Nil #

[View source]
def source : Regex | String | Nil #

[View source]
def test(msg : Crirc::Protocol::Message) #

[View source]