Bot::Net::Message - encapsulate messages to and from bots


  my $message = Bot::Net::Message->new({
      sender_nick     => $from_nick,
      sender_host     => $from_host,
      recipient_nicks => $to_nick,
      message         => $message,
      public          => 0,


Just a simple class for encapsulating bot messages.



Create a new message. The HASHREF keys can be the name of any of the accessor methods described for this class. The values are the values to assign to each key.

sender_nick [ NICK ]

This accessor contains the nick of the message's sender. Pass an argument to change the value.

sender_host [ HOST ]

This accessor contains the host of the message's sender. Pass an argument to change the value.

recipient_nicks [ NICKS ]

This accessor returns a reference to an array of nicks that recieved the message. This is generally only set of "private" returns a true value. You may pass a nick or array of nicks to set this value.

recipient_groups [ GROUPS ]

This returns the groups that recieved a public message. This should be set only when "public" returns true. You may pass a group or an array of groups to set here.

message [ MESSAGE ]

This accessor returns the message that was sent. Pass a parameter or array of parameters to alter the message. If an array is passed, the elements of the array will be joined using $, (i.e., $OUTPUT_FIELD_SEPARATOR for those who use English).

public [ BOOL ]

Returns true if the message sent was sent to a chat group rather than directly to a set of nicks. Pass a true or false value in to alter the value. If this is set to true, then "private" will be set to false and vice versa.

private [ BOOL ]

Returns true if the message was sent to a specific set of nicks rather than to a chat group. Pass a true or false value to alter the value. The opposite value will be returned by "public".


Andrew Sterling Hanenkamp <>


Copyright 2007 Boomer Consulting, Inc. All Rights Reserved.

This program is free software and may be modified and distributed under the same terms as Perl itself.