Example #1
0
 public function help()
 {
     $channel = $this->event->getRequest()->getSource();
     $lines = array('This is OftBot - a 1, 4, 24 IRC bot.', '  OftBot receives commands of the form \'@oftbot <command>\'.', '  OftBot accepts these commands: suggest, killgame, join, leave, kick, start, roll, keep (also available as k), help, and status.', '  For more information, see https://github.com/triplepoint/OftBot .');
     foreach ($lines as $line) {
         $this->event->addResponse(Response::notice($channel, $line));
     }
 }
 /**
  * Add an error message to the response.
  *
  * @param \Philip\IRC\Event $event The event to add a response to
  * @param string $msg The error message to send
  *
  * @return void
  */
 public function addErrorMsg($event, $msg)
 {
     $event->addResponse(Response::msg($event->getRequest()->getSource(), $msg));
 }
Example #3
0
 public function testGetResponses()
 {
     $this->if($this->mockGenerator->shuntParentClassCalls())->and($request = new \mock\Philip\IRC\Request($raw = uniqid()))->and($object = new TestedClass($request))->and($matches = array(uniqid(), uniqid()))->then->array($object->getResponses())->isEmpty()->if($response = new \Philip\IRC\Response(uniqid()))->and($object->addResponse($response))->then->array($object->getResponses())->isEqualTo(array($response))->if($otherResponse = new \Philip\IRC\Response(uniqid()))->and($object->addResponse($otherResponse))->then->array($object->getResponses())->isEqualTo(array($response, $otherResponse));
 }