Plugins

Exporter
Plugins
Summary
Plugins
Variables
@EXPORT
Plugin Hashes
Functions
registerPluginIs called from each plugin to register Adds plugin to %plugins and %descriptions
getFuncIs called when Bot gets a message.
getIdleFuncIs called every 15 seconds
getDescLooksup the description of a plugin
getPluginsa list of all plugin keys
getShortDescshort Description for a Plugin

Variables

@EXPORT

our @EXPORT

Plugin Hashes

%pluginsHash of plugins with key=command and value=reference to function in plugin
@idlefunctionsList of refereces to idlefunctions of plugins (this function gets called every 15 seconds)
%descriptionsHash of plugins with key=command and value=description of plugin for help command
%shortDescriptionsHash of plugins with key=command and value=shortdescription of plugin to give a short description for each plugin at the help command

Functions

registerPlugin

sub registerPlugin

Is called from each plugin to register Adds plugin to %plugins and %descriptions

Parameters

$keywordCommand to activate plugin
$functionReference to plugin function
$descriptionString with description of plugin for help command

getFunc

sub getFunc

Is called when Bot gets a message.  Checks if the first word is key of a plugin.  If it is then the reference to the pluginfunction is returned.  Else 0 is returned.

Parameters

$keyFirst word of received string.

Returns

Reference to plugin function or 0 (if no such plugin exists)

getIdleFunc

sub getIdleFunc

Is called every 15 seconds

Parameters

$keyFirst word of received string.

Returns

List of References to idlefunctions of plugins

getDesc

sub getDesc

Looksup the description of a plugin

Parameters

$keyCommand of the plugin

Returns

Description of plugin or errormessage (if plugin doesn’t exists)

getPlugins

sub getPlugins

Returns

a list of all plugin keys

getShortDesc

sub getShortDesc

Returns

short Description for a Plugin

our @EXPORT
sub registerPlugin
Is called from each plugin to register Adds plugin to %plugins and %descriptions
sub getFunc
Is called when Bot gets a message.
sub getIdleFunc
Is called every 15 seconds
sub getDesc
Looksup the description of a plugin
sub getPlugins
a list of all plugin keys
sub getShortDesc
short Description for a Plugin
Close