POE::Component::IRC::Plugin::BotTraffic - A PoCo-IRC plugin that generates events when you send messages
use POE::Component::IRC::Plugin::BotTraffic; $irc->plugin_add( 'BotTraffic', POE::Component::IRC::Plugin::BotTraffic->new() ); sub irc_bot_public { my ($kernel, $heap) = @_[KERNEL, HEAP]; my $channel = $_[ARG0]->[0]; my $what = $_[ARG1]; print "I said '$what' on channel $channel\n"; return; }
POE::Component::IRC::Plugin::BotTraffic is a POE::Component::IRC plugin. It watches for when your bot sends PRIVMSGs and NOTICEs to the server and generates the appropriate events.
These events are useful for logging what your bot says.
new
No arguments required. Returns a plugin object suitable for feeding to POE::Component::IRC's plugin_add method.
plugin_add
These are the events generated by the plugin. Both events have ARG0 set to an arrayref of recipients and ARG1 the text that was sent.
ARG0
ARG1
irc_bot_public
ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
irc_bot_msg
irc_bot_action
irc_bot_notice
Chris 'BinGOs' Williams [chris@bingosnet.co.uk]
POE::Component::IRC
To install POE::Component::IRC, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE::Component::IRC
CPAN shell
perl -MCPAN -e shell install POE::Component::IRC
For more information on module installation, please visit the detailed CPAN module installation guide.