1POE::Component::IRC::PlUusgeirn:C:oCnTtCrPi(b3u)ted PerlPODEo:c:uCmoemnptoanteinotn::IRC::Plugin::CTCP(3)
2
3
4
6 POE::Component::IRC::Plugin::CTCP - A PoCo-IRC plugin that
7 auto-responds to CTCP requests
8
10 use strict;
11 use warnings;
12 use POE qw(Component::IRC Component::IRC::Plugin::CTCP);
13
14 my $nickname = 'Flibble' . $$;
15 my $ircname = 'Flibble the Sailor Bot';
16 my $ircserver = 'irc.blahblahblah.irc';
17 my $port = 6667;
18
19 my $irc = POE::Component::IRC->spawn(
20 nick => $nickname,
21 server => $ircserver,
22 port => $port,
23 ircname => $ircname,
24 ) or die "Oh noooo! $!";
25
26 POE::Session->create(
27 package_states => [
28 main => [ qw(_start) ],
29 ],
30 );
31
32 $poe_kernel->run();
33
34 sub _start {
35 # Create and load our CTCP plugin
36 $irc->plugin_add( 'CTCP' => POE::Component::IRC::Plugin::CTCP->new(
37 version => $ircname,
38 userinfo => $ircname,
39 ));
40
41 $irc->yield( register => 'all' );
42 $irc->yield( connect => { } );
43 return:
44 }
45
47 POE::Component::IRC::Plugin::CTCP is a POE::Component::IRC plugin. It
48 watches for "irc_ctcp_version", "irc_ctcp_userinfo", "irc_ctcp_ping",
49 "irc_ctcp_time" and "irc_ctcp_source" events and autoresponds on your
50 behalf.
51
53 "new"
54 Takes a number of optional arguments:
55
56 'version', a string to send in response to "irc_ctcp_version". Default
57 is PoCo-IRC and version;
58
59 'clientinfo', a string to send in response to "irc_ctcp_clientinfo".
60 Default is
61 <http://search.cpan.org/perldoc?POE::Component::IRC::Plugin::CTCP>.
62
63 'userinfo', a string to send in response to "irc_ctcp_userinfo".
64 Default is 'm33p';
65
66 'source', a string to send in response to "irc_ctcp_source". Default is
67 <http://search.cpan.org/dist/POE-Component-IRC>.
68
69 'eat', by default the plugin uses PCI_EAT_CLIENT, set this to 0 to
70 disable this behaviour;
71
72 Returns a plugin object suitable for feeding to POE::Component::IRC's
73 "plugin_add" method.
74
75 "eat"
76 With no arguments, returns true or false on whether the plugin is
77 "eating" CTCP events that it has dealt with. An argument will set
78 "eating" to on or off appropriately, depending on whether the value is
79 true or false.
80
82 Chris 'BinGOs' Williams
83
85 CTCP Specification <http://www.irchelp.org/irchelp/rfc/ctcpspec.html>.
86
87
88
89perl v5.36.0 2023-01-2P0OE::Component::IRC::Plugin::CTCP(3)