POE::C...Traffic(3pm)
β¨ POE::Component::IRC::Plugin::BotTraffic β the manual, but make it a vibe β¨
okay bestie, so this is a page from the User Contributed Perl Documentation set, and it's about POE::Component::IRC::Plugin::BotTraffic, which lives in the 3pm section of your friendly neighbourhood man pages. Lowkey a mouthful of a name, highkey worth it. Let's get into it π
πΈ NAME πΈ
POE::Component::IRC::Plugin::BotTraffic β a PoCo-IRC plugin that generates events when you send messages π
Like, the whole point is: your bot says something, and this plugin is right there going "noted π" and firing off an event about it. It's giving personal hype squad for your own IRC traffic.
β SYNOPSIS β
Here's the whole vibe in code form, no cap:
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;
}
See how you use it, plugin_add it with a name ('BotTraffic' bestie, keep up π), and then boom β you've got a handler sub called irc_bot_public that grabs KERNEL and HEAP out of @_, pulls the channel out of $_[ARG0]->[0], pulls the text out of $_[ARG1], prints that iconic little line, and returns. Chef's kiss. Periodt. π
π¦ DESCRIPTION π¦
POE::Component::IRC::Plugin::BotTraffic is a POE::Component::IRC plugin. That's the family it belongs to, it's not trying to be anything it's not, love that for it.
What it does: it watches for when your bot sends PRIVMSGs and NOTICEs to the server, and it generates the appropriate events. So it's not spying on other people β it's watching you, bestie. Main character energy only. π
Where these events come in clutch: logging what your bot says. Every iconic quote, archived. π
π METHODS π
new
No arguments required. Zero. Nada. You just call it and it hands you back a plugin object suitable for feeding to POE::Component::IRC's plugin_add method. That's it. That's the method. Slay. β¨
π OUTPUT EVENTS π
These are the events generated by the plugin. Spill them in your session, handle them, live your life.
Quick thing before we list them all, because it applies to both/every one of them: both events have ARG0 set to an arrayref of recipients, and ARG1 is the text that was sent. So like, who you said it to, and what you said. Iykyk.
Now the lineup, one by one:
irc_bot_public
ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
Yep, that's the public one β the one your irc_bot_public handler in the synopsis is vibing with.
irc_bot_msg
ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
The private-message flavour. Same shape, different context. π«Ά
irc_bot_action
ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
It's a /me moment. Slash me, but make it an event. π
irc_bot_notice
ARG0 will be an arrayref of recipients. ARG1 will be the text sent.
The NOTICE energy. Got its own event, as it deserves. π
Heads up bestie: no cap, all four of these are literally identical in structure βARG0= recipients arrayref,ARG1= the text sent. The difference is which kind of traffic triggered them. Don't overthink it. π
π AUTHOR π
Chris 'BinGOs' Williams [chris@bingosnet.co.uk](mailto:chris@bingosnet.co.uk)
Absolute legend tbh. Thank you for your service, king. π«‘π
π SEE ALSO π
POE::Component::IRC
Go read that one next, it's the whole ecosystem your new plugin is living in. π¦
and that's the tea π β this page came to you from perl v5.40.1, dated 2025-08-21, in the POE::C...Traffic(3pm) slot of the User Contributed Perl Documentation. now go log your bot's messages and feel very cute about it β¨π π
π¦ 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