Rechercher une page de manuel
POE::Component::IRC::Plugin::BotTraffic.3pm
Langue: en
Version: 2008-02-22 (mandriva - 01/05/08)
Section: 3 (Bibliothèques de fonctions)
NAME
POE::Component::IRC::Plugin::BotTraffic - A PoCo-IRC plugin that generates 'irc_bot_public', 'irc_bot_msg', and 'irc_bot_action' events whenever your bot sends privmsgs.SYNOPSIS
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; }
DESCRIPTION
POE::Component::IRC::Plugin::BotTraffic is a POE::Component::IRC plugin. It watches for when your bot sends privmsgs to the server. If your bot sends a privmsg to a channel ( ie. the recipient is prefixed with '#', '&', or '+' ) it generates an 'irc_bot_public' event, otherwise it will generate an 'irc_bot_msg' event.These events are useful for logging what your bot says.
METHODS
- "new"
- No arguments required. Returns a plugin object suitable for feeding to POE::Component::IRC's plugin_add() method.
OUTPUT
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.- "irc_bot_public"
- ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
- "irc_bot_msg"
- ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
- "irc_bot_action"
- ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
AUTHOR
Chris 'BinGOs' Williams [chris@bingosnet.co.uk]SEE ALSO
POE::Component::IRCContenus ©2006-2024 Benjamin Poulain
Design ©2006-2024 Maxime Vantorre