POE::C...n::CTCP(3pm)

πŸ“¦
version 6.95 Β· 4 versions
, in ubuntu resolute, ubuntu stonking

πŸ’… NAME πŸ’…

POE::Component::IRC::Plugin::CTCP β€” a PoCo-IRC plugin that auto-responds to CTCP requests 🫢

Like, bestie, this is the little plugin that answers the door when someone knocks with a CTCP, so you don't have to πŸŽ€


✨ 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:
}

No cap, that's the whole starter pack πŸ’–


🌸 DESCRIPTION 🌸

POE::Component::IRC::Plugin::CTCP is a POE::Component::IRC plugin. It just kinda... sits there, watching for irc_ctcp_version, irc_ctcp_userinfo, irc_ctcp_ping, irc_ctcp_time and irc_ctcp_source events, and then autoresponds on your behalf. It's giving personal assistant energy, fr fr πŸ‘‘


πŸ¦‹ METHODS πŸ¦‹

πŸŽ€ new πŸŽ€

Takes a number of optional arguments, and yeah they're all optional, so breathe:

  • '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' 🍼 (yes really, iconic behaviour honestly)
  • 'source' β€” a string to send in response to irc_ctcp_source. Default is <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. Feed it well πŸ“

πŸ’… 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.

Lowkey note: it's a vibe check on whether the plugin is out here consuming the CTCP events it handled. Give it a true-ish value and it starts snacking; give it a false-ish one and it stops πŸͺ

πŸ‘‘ AUTHOR πŸ‘‘

Chris 'BinGOs' Williams ✨ absolute legend, we stan 🫢


🌈 SEE ALSO 🌈

CTCP Specification <http://www.irchelp.org/irchelp/rfc/ctcpspec.html>.


And that's the whole page, bestie! πŸ’– This one's from your girl perl v5.40.1, dated 2025-08-21 β€” go drink some water and go answer those CTCPs πŸ’…βœ¨

πŸ“¦ where this page comes from