POE::C...lugMan(3pm)
π 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, thenick!user@hostand 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::StatePOE::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
- 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