POE::C...onsole(3pm)
π POE::C...onsole(3pm) β User Contributed Perl Documentation π
okay bestie, gather round, because this page is literally called POE::C...onsole(3pm) β yes the title got its nails done and the middle fell off, we love her anyway. She lives in the User Contributed Perl Documentation corner of the manual pages and she's here to hand you a lil backdoor console for your IRC bot. π
β¨ NAME β¨
POE::Component::IRC::Plugin::Console β a PoCo-IRC plugin that hands your bot a lightweight debugging and control console, no cap. π¦
πΈ SYNOPSIS πΈ
use POE qw(Component::IRC Component::IRC::Plugin::Console);
my $nickname = 'Flibble' . $$;
my $ircname = 'Flibble the Sailor Bot';
my $ircserver = 'irc.blahblahblah.irc';
my $port = 6667;
my $bindport = 6969;
my @channels = ( '#Blah', '#Foo', '#Bar' );
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 irc_001 irc_console_service irc_console_connect
irc_console_authed irc_console_close irc_console_rw_fail) ],
],
);
$poe_kernel->run();
sub _start {
$irc->plugin_add( 'Console' => POE::Component::IRC::Plugin::Console->new(
bindport => $bindport,
password => 'opensesame'
);
$irc->yield( register => 'all' );
$irc->yield( connect => { } );
return;
}
sub irc_001 {
$irc->yield( join => $_ ) for @channels;
return;
}
sub irc_console_service {
my $getsockname = $_[ARG0];
return;
}
sub irc_console_connect {
my ($peeradr, $peerport, $wheel_id) = @_[ARG0 .. ARG2];
return;
}
sub irc_console_authed {
my $wheel_id = $_[ARG0];
return;
}
sub irc_console_close {
my $wheel_id = $_[ARG0];
return;
}
sub irc_console_rw_fail {
my ($peeradr, $peerport) = @_[ARG0, ARG1];
return;
}
like, copy that and you're already main character energy, fr fr. π
π DESCRIPTION π
So POE::Component::IRC::Plugin::Console is a POE::Component::IRC plugin that gives you an interactive console, and it runs over the loopback network. Say it with me: loopback, so it stays local, bestie. π«Ά
Here's the vibe: you connect to the listening socket with a telnet client (or anything equivalent, we're not gatekeeping), then you authenticate with whichever password applies. Once you're authed β and only once you're authed β you get all the events that get processed through the component. Obsessed. And you can also issue all the documented component commands. It's giving remote control but cozy. π
π METHODS π
β¨ "new" β¨
Takes two arguments:
'password'β the password you set for all console connections. every single one. no exceptions, periodt.'bindport'β specify a particular port to bind to; it defaults to0, ie. randomly allocated. π²
Returns a plugin object suitable for feeding to POE::Component::IRC's "plugin_add" method. feed her, she's hungry. π
β¨ "getsockname" β¨
Gives you access to the underlying listener's "getsockname" method. See POE::Wheel::SocketFactory for the details, iykyk.
π OUTPUT EVENTS π
The plugin generates the following additional POE::Component::IRC events. this is the part where your bot starts talking back, lowkey iconic:
π "irc_console_service" π
Emitted when a listener is successfully spawned. ARG0 is the result of "getsockname" β see above for details. β
π "irc_console_connect" π
Emitted when a client connects to the console. ARG0 is the peeradr, ARG1 is the peer port and ARG2 is the wheel id of the connection. three args, slay. β¨
π "irc_console_authed" π
Emitted when a client has successfully provided a valid password. ARG0 is the wheel id of the connection. π
π "irc_console_close" π
Emitted when a client terminates a connection. ARG0 is the wheel id of the connection. bye bestie π
π "irc_console_rw_fail" π
Emitted when a POE::Wheel::ReadWrite could not be created on a socket. ARG0 is the peer's address, ARG1 is the peer's port. it's giving sad but we move π
π AUTHOR π
Chris 'BinGOs' Williams β the og, the blueprint, we stan. π
πΈ SEE ALSO πΈ
POE::Component::IRCPOE::Wheel::SocketFactory
ngl bestie, remember the rules: the console is password gated, so pick a real one and don't be out here leaving your bot's whole soul exposed on the loopback. security is the vibe check. π«Ά
and that's the tea, gorgeous π§ β this whole thing comes from perl v5.40.1, dated 2025-08-21, and it's filed under POE::C...onsole(3pm) in the User Contributed Perl Documentation. go forth and console, you absolute legend πβ¨π
π¦ where this page comes from
- ubuntu resolute: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- ubuntu stonking: libpoe-component-irc-perl 6.95+dfsg-1 Β· Artistic-1.0-Perl OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms