Bot::Cobalt::IRC::Message - An incoming IRC message
sub Bot_private_msg { my ($self, $core) = splice @_, 0, 2; my $msg = ${ $_[0] }; my $context = $msg->context; my $stripped = $msg->stripped; my $nickname = $msg->src_nick; . . . }
Incoming IRC messages are broadcast to the plugin pipeline via Bot::Cobalt::IRC; this is the base class providing an easy object interface to parsed messages.
This is the most frequently used Event subclass; the methods inherited from Bot::Cobalt::IRC::Event are also documented here for convenience.
Returns the server context name.
Returns the full source of the message in the form of nick!user@host
nick!user@host
The 'nick' portion of the message's "src".
The 'user' portion of the message's "src".
May be undefined if the message was "odd."
The 'host' portion of the message's "src".
An array reference containing any seen destinations for this message.
The first seen destination, as a string.
Same as $msg->targets->[0]
$msg->targets->[0]
Undefined if the destination for the message doesn't appear to be a properly-prefixed channel; otherwise the same value as "target".
The unstripped, unparsed message string we were originally given.
The color and formatting stripped "message".
An array reference containing the message string split on white space.
"Extra" spaces are not preserved; see "message_array_sp".
message_array can be modified in the case of command-prefixed public messages; see "cmd" in Bot::Cobalt::IRC::Message::Public.
Similar to "message_array", except all spaces are preserved, including leading spaces.
Bot::Cobalt::IRC::Message::Public -- subclass for public messages
Bot::Cobalt::IRC::Event -- base class for IRC events
Bot::Cobalt::Manual::Plugins
Jon Portnoy <avenj@cobaltirc.org>
http://www.cobaltirc.org
To install Bot::Cobalt, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Cobalt
CPAN shell
perl -MCPAN -e shell install Bot::Cobalt
For more information on module installation, please visit the detailed CPAN module installation guide.