Property | Type | Description | |
---|---|---|---|
$client | Phergie\Irc\Client\React\ClientInterface | IRC client in use by the bot | |
$config | array | Configuration in use by the bot | |
$converter | Phergie\Irc\Event\ParserConverterInterface | Converter for event data from the IRC client's underlying parser | |
$logger | Psr\Log\LoggerInterface | Logger in use by the bot, defaults to logger in use by the IRC client | |
$parser | Phergie\Irc\ParserInterface | Parser for converting generated IRC commands into event objects | |
$queueFactory | Phergie\Irc\Bot\React\EventQueueFactoryInterface | Event queue factory for creating connection-specific event queues |
Method | Description | |
---|---|---|
getClient ( ) : Phergie\Irc\Client\React\ClientInterface | Returns the IRC client in use by the bot. | |
getConfig ( ) : array | Returns the configuration in use by the bot. | |
getConverter ( ) : Phergie\Irc\Event\ParserConverterInterface | Returns the parser converter for event data in use by the bot. | |
getEventQueueFactory ( ) : Phergie\Irc\Bot\React\EventQueueFactoryInterface | Returns the event queue factory in use by the bot. | |
getLogger ( ) : Psr\Log\LoggerInterface | Returns the logger in use by the bot. | |
getParser ( ) : Phergie\Irc\ParserInterface | Returns the parser for generated event data in use by the bot. | |
processClientEvent ( string $event, array $message, Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write ) | Callback to process client events. Not intended to be called from outside this class. | |
processOutgoingEvents ( Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write ) | Callback to process any queued outgoing events. Not intended to be called from outside thie class. | |
run ( boolean $autorun = true ) | Initiates an event loop for the bot in which it will connect to servers and monitor those connections for events to forward to plugins. | |
setClient ( Phergie\Irc\Client\React\ClientInterface $client ) | Sets the IRC client for the bot to use. | |
setConfig ( array $config ) | Sets the configuration to be used by the bot in its operations. | |
setConverter ( Phergie\Irc\Event\ParserConverterInterface $converter ) | Sets the parser converter for event data in use by the bot. | |
setEventQueueFactory ( Phergie\Irc\Bot\React\EventQueueFactoryInterface $queueFactory ) | Sets the event queue factory for the bot to use. | |
setLogger ( Psr\Log\LoggerInterface $logger ) | Sets the logger in use by the bot. | |
setParser ( Phergie\Irc\ParserInterface $parser ) | Sets the parser for generated event data in use by the bot. |
Method | Description | |
---|---|---|
getConnections ( array $config ) : Phergie\Irc\ConnectionInterface[] | Extracts connections from configuration. | |
getDefaultPluginProcessors ( ) : Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[] | Returns a list of default plugin processors used when none are set via configuration. | |
getEventSubtype ( Phergie\Irc\Event\EventInterface $event ) : string | Returns an event subtype corresponding to a given event object, used to generate event names when emitting events. | |
getPluginProcessors ( array $config ) | Returns a list of processors for plugins. | |
getPlugins ( array $config ) : Phergie\Irc\Bot\React\PluginInterface[] | Extracts plugins from configuration. | |
processPlugins ( array $plugins, array $processors, SplObjectStorage $processedPlugins = null ) | Processes a list of plugins for use. | |
registerClientSubscribers ( Phergie\Irc\Client\React\ClientInterface $client ) | Configures the client to emit events for specific types of messages. | |
registerPluginSubscribers ( array $plugins ) | Registers event callbacks from plugins. | |
setDependencyOverrides ( array $config ) | Sets dependencies from configuration. | |
validatePluginEvents ( Phergie\Irc\Bot\React\PluginInterface $plugin ) | Validates a plugin's event callbacks. |
public getClient ( ) : Phergie\Irc\Client\React\ClientInterface | ||
return | Phergie\Irc\Client\React\ClientInterface |
protected getConnections ( array $config ) : Phergie\Irc\ConnectionInterface[] | ||
$config | array | Associative array keyed by setting name |
return | Phergie\Irc\ConnectionInterface[] |
public getConverter ( ) : Phergie\Irc\Event\ParserConverterInterface | ||
return | Phergie\Irc\Event\ParserConverterInterface |
protected getDefaultPluginProcessors ( ) : Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[] | ||
return | Phergie\Irc\Bot\React\PluginProcessor\PluginProcessorInterface[] |
public getEventQueueFactory ( ) : Phergie\Irc\Bot\React\EventQueueFactoryInterface | ||
return | Phergie\Irc\Bot\React\EventQueueFactoryInterface |
protected getEventSubtype ( Phergie\Irc\Event\EventInterface $event ) : string | ||
$event | Phergie\Irc\Event\EventInterface | |
return | string |
public getLogger ( ) : Psr\Log\LoggerInterface | ||
return | Psr\Log\LoggerInterface |
public getParser ( ) : Phergie\Irc\ParserInterface | ||
return | Phergie\Irc\ParserInterface |
protected getPluginProcessors ( array $config ) | ||
$config | array | Associative array keyed by setting name |
protected getPlugins ( array $config ) : Phergie\Irc\Bot\React\PluginInterface[] | ||
$config | array | Associative array keyed by setting name |
return | Phergie\Irc\Bot\React\PluginInterface[] |
public processClientEvent ( string $event, array $message, Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write ) | ||
$event | string | Received client event |
$message | array | Parsed message |
$connection | Phergie\Irc\ConnectionInterface | Connection on which the event occurred |
$write | Phergie\Irc\Client\React\WriteStream | Stream used to send commands to the server |
public processOutgoingEvents ( Phergie\Irc\ConnectionInterface $connection, Phergie\Irc\Client\React\WriteStream $write ) | ||
$connection | Phergie\Irc\ConnectionInterface | Connection on which the event occurred |
$write | Phergie\Irc\Client\React\WriteStream | Stream used to send commands to the server |
protected processPlugins ( array $plugins, array $processors, SplObjectStorage $processedPlugins = null ) | ||
$plugins | array | |
$processors | array | |
$processedPlugins | SplObjectStorage |
protected registerClientSubscribers ( Phergie\Irc\Client\React\ClientInterface $client ) | ||
$client | Phergie\Irc\Client\React\ClientInterface | Client for which to configure events |
protected registerPluginSubscribers ( array $plugins ) | ||
$plugins | array | Plugins from which to get callbacks |
public setClient ( Phergie\Irc\Client\React\ClientInterface $client ) | ||
$client | Phergie\Irc\Client\React\ClientInterface |
public setConverter ( Phergie\Irc\Event\ParserConverterInterface $converter ) | ||
$converter | Phergie\Irc\Event\ParserConverterInterface |
protected setDependencyOverrides ( array $config ) | ||
$config | array |
public setEventQueueFactory ( Phergie\Irc\Bot\React\EventQueueFactoryInterface $queueFactory ) | ||
$queueFactory | Phergie\Irc\Bot\React\EventQueueFactoryInterface |
public setLogger ( Psr\Log\LoggerInterface $logger ) | ||
$logger | Psr\Log\LoggerInterface |
public setParser ( Phergie\Irc\ParserInterface $parser ) | ||
$parser | Phergie\Irc\ParserInterface |
protected validatePluginEvents ( Phergie\Irc\Bot\React\PluginInterface $plugin ) | ||
$plugin | Phergie\Irc\Bot\React\PluginInterface |
protected ClientInterface,Phergie\Irc\Client\React $client | ||
return | Phergie\Irc\Client\React\ClientInterface |
protected ParserConverterInterface,Phergie\Irc\Event $converter | ||
return | Phergie\Irc\Event\ParserConverterInterface |
protected LoggerInterface,Psr\Log $logger | ||
return | Psr\Log\LoggerInterface |
protected ParserInterface,Phergie\Irc $parser | ||
return | Phergie\Irc\ParserInterface |