Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

poe::component::irc::plugin::ctcp(3pm) [debian man page]

POE::Component::IRC::Plugin::CTCP(3pm)			User Contributed Perl Documentation		    POE::Component::IRC::Plugin::CTCP(3pm)

NAME
POE::Component::IRC::Plugin::CTCP - A PoCo-IRC plugin that auto-responds to CTCP requests SYNOPSIS
use strict; use warnings; use POE qw(Component::IRC Component::IRC::Plugin::CTCP); my $nickname = 'Flibble' . $$; my $ircname = 'Flibble the Sailor Bot'; my $ircserver = 'irc.blahblahblah.irc'; my $port = 6667; my $irc = POE::Component::IRC->spawn( nick => $nickname, server => $ircserver, port => $port, ircname => $ircname, ) or die "Oh noooo! $!"; POE::Session->create( package_states => [ main => [ qw(_start) ], ], ); $poe_kernel->run(); sub _start { # Create and load our CTCP plugin $irc->plugin_add( 'CTCP' => POE::Component::IRC::Plugin::CTCP->new( version => $ircname, userinfo => $ircname, )); $irc->yield( register => 'all' ); $irc->yield( connect => { } ); return: } DESCRIPTION
POE::Component::IRC::Plugin::CTCP is a POE::Component::IRC plugin. It watches for "irc_ctcp_version", "irc_ctcp_userinfo", "irc_ctcp_ping", "irc_ctcp_time" and "irc_ctcp_source" events and autoresponds on your behalf. METHODS
"new" Takes a number of optional arguments: 'version', a string to send in response to "irc_ctcp_version". Default is PoCo-IRC and version; 'clientinfo', a string to send in response to "irc_ctcp_clientinfo". Default is <http://search.cpan.org/perldoc?POE::Component::IRC::Plugin::CTCP>. 'userinfo', a string to send in response to "irc_ctcp_userinfo". Default is 'm33p'; 'source', a string to send in response to "irc_ctcp_source". Default is http://search.cpan.org/dist/POE-Component-IRC <http://search.cpan.org/dist/POE-Component-IRC>. 'eat', by default the plugin uses PCI_EAT_CLIENT, set this to 0 to disable this behaviour; Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. "eat" With no arguments, returns true or false on whether the plugin is "eating" CTCP events that it has dealt with. An argument will set "eating" to on or off appropriately, depending on whether the value is true or false. AUTHOR
Chris 'BinGOs' Williams SEE ALSO
CTCP Specification <http://www.irchelp.org/irchelp/rfc/ctcpspec.html>. perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::CTCP(3pm)

Check Out this Related Man Page

POE::Component::IRC::Plugin::Connector(3pm)		User Contributed Perl Documentation	       POE::Component::IRC::Plugin::Connector(3pm)

NAME
POE::Component::IRC::Plugin::Connector - A PoCo-IRC plugin that deals with the messy business of staying connected to an IRC server SYNOPSIS
use POE qw(Component::IRC Component::IRC::Plugin::Connector); my $irc = POE::Component::IRC->spawn(); POE::Session->create( package_states => [ main => [ qw(_start lag_o_meter) ], ], ); $poe_kernel->run(); sub _start { my ($kernel, $heap) = @_[KERNEL ,HEAP]; $irc->yield( register => 'all' ); $heap->{connector} = POE::Component::IRC::Plugin::Connector->new(); $irc->plugin_add( 'Connector' => $heap->{connector} ); $irc->yield ( connect => { Nick => 'testbot', Server => 'someserver.com' } ); $kernel->delay( 'lag_o_meter' => 60 ); return; } sub lag_o_meter { my ($kernel,$heap) = @_[KERNEL,HEAP]; print 'Time: ' . time() . ' Lag: ' . $heap->{connector}->lag() . " "; $kernel->delay( 'lag_o_meter' => 60 ); return; } DESCRIPTION
POE::Component::IRC::Plugin::Connector is a POE::Component::IRC plugin that deals with making sure that your IRC bot stays connected to the IRC network of your choice. It implements the general algorithm as demonstrated at <http://poe.perl.org/?POE_Cookbook/IRC_Bot_Reconnecting>. METHODS
"new" Takes two optional arguments: 'delay', the frequency, in seconds, at which the plugin will ping the IRC server. Defaults to 300. 'reconnect', the time in seconds, to wait before trying to reconnect to the server. Defaults to 60. 'servers', an array reference of IRC servers to consider. Each element should be an array reference containing a server host and (optionally) a port number. The plugin will cycle through this list of servers whenever it reconnects. Returns a plugin object suitable for use in POE::Component::IRC's "plugin_add" method. "lag" Returns the current 'lag' in seconds between sending PINGs to the IRC server and getting PONG responses. Probably not likely to be wholely accurate. AUTHOR
Chris "BinGOs" Williams <chris@bingosnet.co.uk> SEE ALSO
POE::Component::IRC POE::Component::IRC::Plugin perl v5.14.2 2011-12-07 POE::Component::IRC::Plugin::Connector(3pm)
Man Page