.\" Automatically generated by Pod::Man 4.14 (Pod::Simple 3.40) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "POE::Component::IRC::Plugin::PlugMan 3pm" .TH POE::Component::IRC::Plugin::PlugMan 3pm "2021-09-30" "perl v5.32.1" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" POE::Component::IRC::Plugin::PlugMan \- A PoCo\-IRC plugin that provides plugin management services. .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 4 \& use strict; \& use warnings; \& use POE qw(Component::IRC::State); \& use POE::Component::IRC::Plugin::PlugMan; \& \& my $botowner = \*(Aqsomebody!*@somehost.com\*(Aq; \& my $irc = POE::Component::IRC::State\->spawn(); \& \& POE::Session\->create( \& package_states => [ \& main => [ qw(_start irc_plugin_add) ], \& ], \& ); \& \& sub _start { \& $irc\->yield( register => \*(Aqall\*(Aq ); \& $irc\->plugin_add( \*(AqPlugMan\*(Aq => POE::Component::IRC::Plugin::PlugMan\->new( botowner => $botowner ) ); \& return; \& } \& \& sub irc_plugin_add { \& my ($desc, $plugin) = @_[ARG0, ARG1]; \& \& if ($desc eq \*(AqPlugMan\*(Aq) { \& $plugin\->load( \*(AqConnector\*(Aq, \*(AqPOE::Component::IRC::Plugin::Connector\*(Aq ); \& } \& return; \& } .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" POE::Component::IRC::Plugin::PlugMan is a POE::Component::IRC plugin management plugin. It provides support for 'on\-the\-fly' loading, reloading and unloading of plugin modules, via object methods that you can incorporate into your own code and a handy \s-1IRC\s0 interface. .SH "METHODS" .IX Header "METHODS" .ie n .SS """new""" .el .SS "\f(CWnew\fP" .IX Subsection "new" Takes two optional arguments: .PP \&\fB'botowner'\fR, an \s-1IRC\s0 mask to match against for people issuing commands via the \&\s-1IRC\s0 interface; .PP \&\fB'auth_sub'\fR, a sub reference which will be called to determine if a user may issue commands via the \s-1IRC\s0 interface. Overrides \fB'botowner'\fR. It will be called with three arguments: the \s-1IRC\s0 component object, the nick!user@host and the channel name as arguments. It should return a true value if the user is authorized, a false one otherwise. .PP \&\fB'debug'\fR, set to a true value to see when stuff goes wrong; .PP Not setting \fB'botowner'\fR or \fB'auth_sub'\fR effectively disables the \s-1IRC\s0 interface. .PP If \fB'botowner'\fR is specified the plugin checks that it is being loaded into a POE::Component::IRC::State or sub-class and will fail to load otherwise. .PP Returns a plugin object suitable for feeding to POE::Component::IRC's \f(CW\*(C`plugin_add\*(C'\fR method. .ie n .SS """load""" .el .SS "\f(CWload\fP" .IX Subsection "load" Loads a managed plugin. .PP Takes two mandatory arguments, a plugin descriptor and a plugin package name. Any other arguments are used as options to the loaded plugin constructor. .PP .Vb 1 \& $plugin\->load( \*(AqConnector\*(Aq, \*(AqPOE::Component::IRC::Plugin::Connector\*(Aq, delay, 120 ); .Ve .PP Returns true or false depending on whether the load was successfully or not. .ie n .SS """unload""" .el .SS "\f(CWunload\fP" .IX Subsection "unload" Unloads a managed plugin. .PP Takes one mandatory argument, a plugin descriptor. .PP .Vb 1 \& $plugin\->unload( \*(AqConnector\*(Aq ); .Ve .PP Returns true or false depending on whether the unload was successfully or not. .ie n .SS """reload""" .el .SS "\f(CWreload\fP" .IX Subsection "reload" Unloads and loads a managed plugin, with applicable plugin options. .PP Takes one mandatory argument, a plugin descriptor. .PP .Vb 1 \& $plugin\->reload( \*(AqConnector\*(Aq ); .Ve .ie n .SS """loaded""" .el .SS "\f(CWloaded\fP" .IX Subsection "loaded" Takes no arguments. .PP .Vb 1 \& $plugin\->loaded(); .Ve .PP Returns a list of descriptors of managed plugins. .SH "INPUT" .IX Header "INPUT" An \s-1IRC\s0 interface is enabled by specifying a \*(L"botowner\*(R" mask to \&\f(CW\*(C`new\*(C'\fR. Commands may be either invoked via a \s-1PRIVMSG\s0 directly to your bot or in a channel by prefixing the command with the nickname of your bot. One caveat, the parsing of the irc command is very rudimentary (it merely splits the line on spaces). .ie n .SS """plugin_add""" .el .SS "\f(CWplugin_add\fP" .IX Subsection "plugin_add" Takes the same arguments as \f(CW\*(C`load\*(C'\fR. .ie n .SS """plugin_del""" .el .SS "\f(CWplugin_del\fP" .IX Subsection "plugin_del" Takes the same arguments as \f(CW\*(C`unload\*(C'\fR. .ie n .SS """plugin_reload""" .el .SS "\f(CWplugin_reload\fP" .IX Subsection "plugin_reload" Takes the same arguments as \f(CW\*(C`reload\*(C'\fR. .ie n .SS """plugin_loaded""" .el .SS "\f(CWplugin_loaded\fP" .IX Subsection "plugin_loaded" Returns a list of descriptors of managed plugins. .ie n .SS """plugin_list""" .el .SS "\f(CWplugin_list\fP" .IX Subsection "plugin_list" Returns a list of descriptors of *all* plugins loaded into the current PoCo-IRC component. .SH "AUTHOR" .IX Header "AUTHOR" Chris 'BinGOs' Williams .SH "SEE ALSO" .IX Header "SEE ALSO" POE::Component::IRC::State .PP POE::Component::IRC::Plugin