|
Erebot
latest
A modular IRC bot for PHP 5.3+
|
Interface for core features. More...
Inheritance diagram for Erebot\Interfaces\Core:Public Member Functions | |
| addConnection (\Erebot\Interfaces\Connection $connection) | |
| addTimer (\Erebot\TimerInterface $timer) | |
| getConnections () | |
| getRunningTime () | |
| gettext ($message) | |
| getTimers () | |
| removeConnection (\Erebot\Interfaces\Connection $connection) | |
| removeTimer (\Erebot\TimerInterface $timer) | |
| start (\Erebot\Interfaces\ConnectionFactory $factory) | |
| stop () | |
Interface for core features.
This interface provides the necessary methods to get a basic instance of the bot running.
| Erebot\Interfaces\Core::addConnection | ( | \Erebot\Interfaces\Connection | $connection | ) |
Adds a (new) connection to the bot.
Once a new connection has been created, use this method to add it to the pool of connections the bot must process. This enables the connection to send and receive messages.
| Erebot::Interfaces::Connection | $connection | Adds a connection to the list of connections handled by this instance of the bot. |
| Erebot::InvalidValueException | This connection is already part of the connection pool handled by this instance of the bot. |
| Erebot\Interfaces\Core::addTimer | ( | \Erebot\TimerInterface | $timer | ) |
Registers a timer for this instance.
| Erebot::TimerInterface | $timer | A timer to register. |
Implemented in Erebot\Core.
| Erebot\Interfaces\Core::getConnections | ( | ) |
Returns a list of all connections handled by the bot.
| array | A list of connections handled by this instance, as objects implementing Erebot::Interfaces::Connection. |
Implemented in Erebot\Core.
| Erebot\Interfaces\Core::getRunningTime | ( | ) |
Returns the number of seconds elapsed since the bot was last started.
| false | The bot is not running (Erebot::Interfaces::Core::start() has not been called yet). |
| integer | The number of seconds elapsed since the was last started. |
Implemented in Erebot\Core.
| Erebot\Interfaces\Core::gettext | ( | $message | ) |
Returns the translation of a message in the primary language.
Use this method to get a translated message in the primary language. That is, using the language defined in the "language" attribute of the "configuration" tag in your XML configuration file.
| string | $message | The original message to translate, in english. |
| string | The translation for this message or the original (english) message if no translation is available. |
Implemented in Erebot\Core.
| Erebot\Interfaces\Core::getTimers | ( | ) |
Returns a list of all timers currently registered.
| array | A list of timers registered for this instance, as objects implementing Erebot::TimerInterface. |
Implemented in Erebot\Core.
| Erebot\Interfaces\Core::removeConnection | ( | \Erebot\Interfaces\Connection | $connection | ) |
Removes a connection from the bot.
Use this method to remove a connection from the pool of connections the bot must process, such as when the connection is lost with the remote IRC server.
| Erebot::Interfaces::Connection | $connection | Removes a connection from the list of connections handled by this instance of the bot. |
| Erebot::NotFoundException | The given connection is not part of the connection pool handled by this instance of the bot. |
| Erebot\Interfaces\Core::removeTimer | ( | \Erebot\TimerInterface | $timer | ) |
Unregisters a timer.
| Erebot::TimerInterface | $timer | A timer to unregister. |
Implemented in Erebot\Core.
| Erebot\Interfaces\Core::start | ( | \Erebot\Interfaces\ConnectionFactory | $factory | ) |
Starts the bot.
| Erebot::Interfaces::ConnectionFactory | $factory | Factory to use to create new connections. |
| Erebot\Interfaces\Core::stop | ( | ) |
Stops the bot.
Implemented in Erebot\Core.