Bot-BasicBot
view release on metacpan or search on metacpan
lib/Bot/BasicBot.pm view on Meta::CPAN
=head2 C<port>
The port we're going to use. Defaults to "6667"
=head2 C<password>
The server password for the server we're going to connect to. Defaults to
undef.
=head2 C<ssl>
A boolean to indicate whether or not the server we're going to connect to
is an SSL server. Defaults to 0.
=head2 C<localaddr>
The local address to use, for multihomed boxes. Defaults to undef (use whatever
source IP address the system deigns is appropriate).
=head2 C<useipv6>
A boolean to indicate whether IPv6 should be used. Defaults to undef (use
IPv4).
=head2 C<nick>
The nick we're going to use. Defaults to five random letters
and numbers followed by the word "bot"
=head2 C<alt_nicks>
Alternate nicks that this bot will be known by. These are not nicks
that the bot will try if it's main nick is taken, but rather other
nicks that the bot will recognise if it is addressed in a public
channel as the nick. This is useful for bots that are replacements
for other bots...e.g, your bot can answer to the name "infobot: "
even though it isn't really.
=head2 C<username>
The username we'll claim to have at our ip/domain. By default this
will be the same as our nick.
=head2 C<name>
The name that the bot will identify itself as. Defaults to
"$nick bot" where $nick is the nick that the bot uses.
=head2 C<channels>
The channels we're going to connect to.
=head2 C<quit_message>
The quit message. Defaults to "Bye".
=head2 C<ignore_list>
The list of irc nicks to ignore B<public> messages from (normally
other bots.) Useful for stopping bot cascades.
=head2 C<charset>
IRC has no defined character set for putting high-bit chars into channel.
This attribute sets the encoding to be used for outgoing messages. Defaults
to 'utf8'.
=head2 C<flood>
Set to '1' to disable the built-in flood protection of POE::Compoent::IRC
=head2 C<no_run>
Tells Bot::BasicBot to B<not> run the L<POE kernel|POE::Kernel> at the end
of L<C<run>|/run>, in case you want to do that yourself.
=head2 C<webirc>
A hashref of WEBIRC params - keys C<user>, C<pass>, C<host> and C<ip>. Unless
the network you are connecting to trusts you enough to give you a WEBIRC config
block & password, this won't be of any use to you.
=head1 OTHER METHODS
=head2 C<AUTOLOAD>
Bot::BasicBot implements AUTOLOAD for sending arbitrary states to the
underlying L<POE::Component::IRC|POE::Component::IRC> component. So for a
C<$bot> object, sending
$bot->foo("bar");
is equivalent to
$poe_kernel->post(BASICBOT_ALIAS, "foo", "bar");
=head2 C<log>
Logs the message. This method merely prints to STDERR - If you want smarter
logging, override this method - it will have simple text strings passed in
@_.
=head2 C<ignore_nick>
Takes a nick name as an argument. Return true if this nick should be
ignored. Ignores anything in the ignore list
=head2 C<nick_strip>
Takes a nick and hostname (of the form "nick!hostname") and
returns just the nick
=head2 C<charset_decode>
Converts a string of bytes from IRC (uses
L<C<decode_irc>|IRC::Utils/decode_irc> from L<IRC::Utils|IRC::Utils>
internally) and returns a Perl string.
It can also takes a list (or arrayref or hashref) of strings, and return
a list of strings
( run in 1.400 second using v1.01-cache-2.11-cpan-e93a5daba3e )