public function handleDaddyMessage(Event $event, EventQueue $queue)
 {
     if ($event instanceof UserEvent) {
         $nick = $event->getNick();
         $channel = $event->getSource();
         $params = $event->getParams();
         $text = $params['text'];
         $matched = preg_match("/\\s*who'?s (?:your|ya) ([^?]+)[?]?/i", $text, $matches);
         if ($matched) {
             $msg = "You're my " . $matches[1] . ', ' . $nick . '!';
             $queue->ircPrivmsg($channel, $msg);
         }
     }
 }
Example #2
0
 /**
  * Tests setParams().
  */
 public function testSetParams()
 {
     $params = array('foo' => 'bar');
     $this->event->setParams($params);
     $this->assertSame($params, $this->event->getParams());
 }