Bot::Cobalt::IRC::Message::Public - Public message subclass


  sub Bot_public_msg {
    my ($self, $core) = splice @_, 0, 2;
    my $msg = ${ $_[0] };

    if ($msg->highlight) {
      . . .


This is a subclass of Bot::Cobalt::IRC::Message -- most methods are documented there.

When an incoming message is a public (channel) message, the provided $msg object has the following extra methods available:


The 'myself' attribute can be tweaked to change how "highlight" behaves. By default it will query the Bot::Cobalt::Core instance for an IRC object that can return the bot's current nickname.


If the bot appears to have been highlighted (ie, the message is prefixed with "myself"), this method will return boolean true.

Used to see if someone is "talking to" the bot.


If the message appears to actually be a command and some arguments, cmd will return the specified command and automatically shift the message_array leftwards to drop the command from message_array.

Normally this isn't used directly by plugins other than Bot::Cobalt::IRC; a Message object handed off by a Bot_public_cmd_* event has this done for you already, for example.


Jon Portnoy <>