Exemple de plugins
PluginSayPrinter
// eBot/Plugins/Official/PluginSayPrinter.php
<?php
namespace eBot\Plugins\Official;
use eBot\Plugins\Plugin;
use eTools\Utils\Logger;
use eBot\Exception\Plugin_Exception;
/**
* PluginSayPrinter, test development plugin
*
* @author deStrO
*/
class PluginSayPrinter implements Plugin {
public function init($config) {
Logger::log("Init PluginSayPrinter");
}
public function onEvent($event) {
switch (get_class($event)) {
case \eBot\Events\EventDispatcher::EVENT_SAY:
Logger::log("Event say ".$event->getText());
break;
}
}
public function onEventAdded($name) { }
public function onEventRemoved($name) { }
public function onReload() { }
public function onStart() {
Logger::log("Starting ".get_class($this));
}
public function onEnd() {
Logger::log("Ending ".get_class($this));
}
public function getEventList() {
return array(\eBot\Events\EventDispatcher::EVENT_SAY);
}
}
?>