class Crirc::Binding::Trigger

Overview

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

Defined in:

crirc/binding/trigger.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(command = "PRIVMSG", source = nil, arguments = nil, message = 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) #

returns true if the the message match with the condition of this trigger


[View source]