Ejemplo n.º 1
0
 public function testClass()
 {
     $this->string(TestedClass::pong($host = uniqid()))->isEqualTo('PONG :' . $host)->string(TestedClass::quit($message = uniqid()))->isEqualTo('QUIT :' . $message)->string(TestedClass::join($channel = '#' . uniqid()))->isEqualTo('JOIN ' . $channel)->string(TestedClass::leave($channel))->isEqualTo('PART ' . $channel)->string(TestedClass::msg($who = uniqid(), $message))->isEqualTo('PRIVMSG ' . $who . ' :' . $message)->string(TestedClass::notice($channel, $message))->isEqualTo('NOTICE ' . $channel . ' :' . $message)->string(TestedClass::action($channel, $message))->isEqualTo('PRIVMSG ' . $channel . ' :' . "ACTION " . $message . "")->string(TestedClass::user($nick = uniqid(), $name = uniqid()))->isEqualTo('USER ' . $nick . ' 8 * :' . $name)->string(TestedClass::nick($nick))->isEqualTo('NICK :' . $nick)->string(TestedClass::pass($pass = uniqid()))->isEqualTo('PASS ' . $pass);
 }
Ejemplo n.º 2
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));
     }
 }