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

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

πŸ’– POE::Component::IRC::Plugin::PlugMan πŸ’–

okay bestie, gather round, because this is the plugin that manages your other plugins. she lives in the POE::Component::IRC::Plugin::PlugMan namespace and she is, quite literally, a PoCo-IRC plugin that provides plugin management services. main character energy fr fr πŸ‘‘


✨ SYNOPSIS ✨

like, here's the whole vibe, copy it and go:

use strict;
use warnings;
use POE qw(Component::IRC::State);
use POE::Component::IRC::Plugin::PlugMan;

my $botowner = 'somebody!*@somehost.com';
my $irc = POE::Component::IRC::State->spawn();

POE::Session->create(
    package_states => [
        main => [ qw(_start irc_plugin_add) ],
    ],
);

sub _start {
    $irc->yield( register => 'all' );
    $irc->plugin_add( 'PlugMan' => POE::Component::IRC::Plugin::PlugMan->new( botowner => $botowner ) );
    return;
}

sub irc_plugin_add {
    my ($desc, $plugin) = @_[ARG0, ARG1];

    if ($desc eq 'PlugMan') {
        $plugin->load( 'Connector', 'POE::Component::IRC::Plugin::Connector' );
    }
    return;
}

🌸 DESCRIPTION 🌸

so POE::Component::IRC::Plugin::PlugMan is a PoCo-IRC plugin management plugin β€” yes, a plugin that manages plugins, we love a girl with range. πŸ’…

she gives you 'on-the-fly' loading, reloading and unloading of plugin modules. how? two ways, both slay: via object methods you can drop into your own code, and via a handy IRC interface. iykyk πŸ¦‹


πŸŽ€ METHODS πŸŽ€

πŸ’œ new

Takes two optional arguments (yes babes, the docs say two and then list three, the way that she contains multitudes 😭):

  • 'botowner' β€” an IRC mask to match against, for the people issuing commands via the IRC interface.
  • 'auth_sub' β€” a sub reference that gets called to decide whether a user may issue commands via the IRC interface. She overrides 'botowner'. She gets called with three arguments: the IRC component object, the nick!user@host and the channel name as arguments. Return a true value if the user is authorized, a false one otherwise.
  • 'debug' β€” set to a true value to see when stuff goes wrong πŸ‘€

Not setting 'botowner' or 'auth_sub' effectively disables the IRC interface. periodt.

If 'botowner' is specified, the plugin checks that it's being loaded into a POE::Component::IRC::State or a sub-class of it, and she will fail to load otherwise. no cap, she's picky.

Returns a plugin object suitable for feeding to POE::Component::IRC's plugin_add method.

πŸ’œ load

Loads a managed plugin. ✨

Takes two mandatory arguments: a plugin descriptor and a plugin package name. Any other arguments are used as options to the loaded plugin constructor.

$plugin->load( 'Connector', 'POE::Component::IRC::Plugin::Connector', delay, 120 );

Returns true or false depending on whether the load was successfully or not.

πŸ’œ unload

Unloads a managed plugin. bye babe 🫢

Takes one mandatory argument: a plugin descriptor.

$plugin->unload( 'Connector' );

Returns true or false depending on whether the unload was successfully or not.

πŸ’œ reload

Unloads and loads a managed plugin, with applicable plugin options. it's giving glow-up πŸ’–

Takes one mandatory argument: a plugin descriptor.

$plugin->reload( 'Connector' );

πŸ’œ loaded

Takes no arguments. low maintenance queen.

$plugin->loaded();

Returns a list of descriptors of managed plugins.


🌈 INPUT 🌈

An IRC interface gets enabled by specifying a botowner mask to new. Commands may be either invoked via a PRIVMSG directly to your bot, or in a channel by prefixing the command with the nickname of your bot.

one caveat bestie ⚠️ the parsing of the irc command is very rudimentary β€” it merely splits the line on spaces. so keep it simple, she's not a parser, she's a vibe.

πŸ¦‹ plugin_add

Takes the same arguments as load.

πŸ¦‹ plugin_del

Takes the same arguments as unload.

πŸ¦‹ plugin_reload

Takes the same arguments as reload.

πŸ¦‹ plugin_loaded

Returns a list of descriptors of managed plugins.

πŸ¦‹ plugin_list

Returns a list of descriptors of all plugins loaded into the current PoCo-IRC component. all of them. every single one. obsessed. πŸ‘‘


⭐ AUTHOR ⭐

Chris 'BinGOs' Williams 🫢

πŸ’« SEE ALSO πŸ’«

  • POE::Component::IRC::State
  • POE::Component::IRC::Plugin

okay and that's the whole page babes πŸ’… this was POE::C...lugMan(3pm) from the User Contributed Perl Documentation, riding on perl v5.40.1, dated 2025-08-21. go forth and manage those plugins, bestie β€” you've got this. πŸŽ€πŸ¦‹βœ¨

πŸ“¦ where this page comes from