class Crirc::Binding::Trigger
- Crirc::Binding::Trigger
- Reference
- Object
Overview
The Trigger
define a set of rules.
Theses rules can test an event (message) to "match" with.
Defined in:
crirc/binding/trigger.crConstructors
-
.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.
Instance Method Summary
- #arguments : Regex | String | Nil
- #command : Regex | String
- #message : Regex | String | Nil
- #raw_arguments : Regex | String | Nil
- #source : Regex | String | Nil
-
#test(msg : Crirc::Protocol::Message)
returns true if the the message match with the condition of this trigger
Constructor Detail
- "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 ":".
Instance Method Detail
def test(msg : Crirc::Protocol::Message)
#
returns true if the the message match with the condition of this trigger