Bot::IKCBot::Pluggable - extended Bot::BasicBot::Pluggable for IKC
run IKCBot server.
use Bot::IKCBot::Pluggable; my $bot = Bot::IKCBot::Pluggable->new( ... ALIASNAME => 'ikchan', ikc_ip => '127.0.0.1', ikc_port => 1919, ); $bot->load("Karma"); # you can load any # Bot::BasicBot::Pluggable::Module::* $bot->run;
and you can talk to IKCBot by IKC. IKC specifier is ALIASNAME_IKC/PUBLISHED_STATE.
use POE::Component::IKC::ClientLite; my $msg = "hello!"; my $channel = "#test1919"; my $bot_name = 'ikchan'; my $ikc = POE::Component::IKC::ClientLite::create_ikc_client( ip => '127.0.0.1', port => 1919, name => 'notify-irc', ); $ikc->post($bot_name.'_IKC/say', { body => $msg, channel => $channel });
Bot::IKCBot::Pluggable is IRC bot extends Bot::BasicBot::Pluggable for IKC support. So you can use all Bot::BasicBot::Pluggable::Module::*, Karma, Infobot, Title and so on.
In my case, for sending Nagios's alert message to IRC channel, run IKCBot and define Nagios's command that invokes notify script to send alert message to IKCBot.
If you want to add your own state of POE::Session, you can do it by changing hashref $Bot::IKCBot::Pluggable::STATE_TABLE and define handler function.
use POE; use Bot::IKCBot::Pluggable; $Bot::IKCBot::Pluggable::STATE_TABLE->{important} = "say_2times"; *Bot::IKCBot::Pluggable::say_2times = sub { my($self, $arg) = @_[ OBJECT, ARG0 ]; $self->say($arg); $self->say($arg); }; my $bot = Bot::IKCBot::Pluggable->new( ... );
Additionally, Bot::IKCBot::Pluggable has "notice" method and use "notice" instead of "say"(=privmsg) when replying.
Bot::BasicBot::Pluggable, Bot::BasicBot. POE::Component::IKC::Server, POE::Component::IKC::ClientLite,
HIROSE Masaaki, <hirose31 at gmail.com>
<hirose31 at gmail.com>
http://github.com/hirose31/p5-bot-ikcbot-pluggable/tree/master
Please report any bugs or feature requests to bug-bot-ikcbot-pluggable at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Bot-IKCBot-Pluggable. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-bot-ikcbot-pluggable at rt.cpan.org
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Bot::IKCBot::Pluggable, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Bot::IKCBot::Pluggable
CPAN shell
perl -MCPAN -e shell install Bot::IKCBot::Pluggable
For more information on module installation, please visit the detailed CPAN module installation guide.