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.
HASHREF
This accessor contains the nick of the message's sender. Pass an argument to change the value.
This accessor contains the host of the message's sender. Pass an argument to change the value.
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.
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.
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).
$,
$OUTPUT_FIELD_SEPARATOR
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.
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 <hanenkamp@cpan.org>
<hanenkamp@cpan.org>
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.
To install Bot::Net, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::Net
CPAN shell
perl -MCPAN -e shell install Bot::Net
For more information on module installation, please visit the detailed CPAN module installation guide.