GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  POE::COMPONENT::IRC::PLUGIN::PLUGMAN (3)

.ds Aq ’

NAME

POE::Component::IRC::Plugin::PlugMan - A PoCo-IRC plugin that provides plugin management services.

CONTENTS

SYNOPSIS



 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

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 IRC interface.

METHODS

CWnew

Takes two optional arguments:

<B>’botowner’B>, an IRC mask to match against for people issuing commands via the IRC interface;

<B>’auth_sub’B>, a sub reference which will be called to determine if a user may issue commands via the IRC interface. Overrides <B>’botowner’B>. It will be called with three arguments: the IRC 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.

<B>’debug’B>, set to a true value to see when stuff goes wrong;

Not setting <B>’botowner’B> or <B>’auth_sub’B> effectively disables the IRC interface.

If <B>’botowner’B> 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.

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

CWload

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.

CWunload

Unloads a managed plugin.

Takes one mandatory argument, a plugin descriptor.



 $plugin->unload( Connector );



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

CWreload

Unloads and loads a managed plugin, with applicable plugin options.

Takes one mandatory argument, a plugin descriptor.



 $plugin->reload( Connector );



CWloaded

Takes no arguments.



 $plugin->loaded();



Returns a list of descriptors of managed plugins.

INPUT

An IRC interface is 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, the parsing of the irc command is very rudimentary (it merely splits the line on spaces).

CWplugin_add

Takes the same arguments as load.

CWplugin_del

Takes the same arguments as unload.

CWplugin_reload

Takes the same arguments as reload.

CWplugin_loaded

Returns a list of descriptors of managed plugins.

CWplugin_list

Returns a list of descriptors of *all* plugins loaded into the current PoCo-IRC component.

AUTHOR

Chris ’BinGOs’ Williams

SEE ALSO

POE::Component::IRC::State

POE::Component::IRC::Plugin

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 POE::COMPONENT::IRC::PLUGIN::PLUGMAN (3) 2014-06-28

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.