Ejemplo n.º 1
0
 /**
  * Adds a single command to the bot.
  *
  * @param IRCCommand $command The command to add.
  * @author Daniel Siepmann <*****@*****.**>
  */
 public function addListener(\Library\IRC\Listener\Base $listener)
 {
     $listenerName = \Library\FunctionCollection::getClassName($listener);
     $listener->setIRCConnection($this->bot->getConnection());
     $listener->setIRCBot($this->bot);
     $this->listeners[$listenerName] = $listener;
     $this->bot->log('The following Listener was added to the Bot: "' . $listenerName . '".', 'INFO');
 }
Ejemplo n.º 2
0
 /**
  * Adds a single command to the bot.
  *
  * @param IRCCommand $command The command to add.
  * @author Daniel Siepmann <*****@*****.**>
  */
 public function addCommand(\Library\IRC\Command\Base $command)
 {
     $commandName = \Library\FunctionCollection::getClassName($command);
     $command->setIRCConnection($this->bot->getConnection());
     $command->setIRCBot($this->bot);
     $this->commands[$commandName] = $command;
     $this->bot->log('The following Command was added to the Bot: "' . $commandName . '".', 'INFO');
 }