POE::C...Traffic(3pm)

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

✨ 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