src/Plugin.php
public function handleEvent(Event $event, Queue $queue)
    {
        if ($event instanceof UserEvent) {
            $nick = $event->getNick();
            $channel = $event->getSource();
            $params = $event->getParams();
            $text = $params['text'];
            $matched = stripos($text, '8 ball') !== false;
            if ($matched) {
                $msg = $nick . ', the magic 8 ball says "' . $this->getMagicEightBallAnswer() . '"';
                $queue->ircPrivmsg($channel, $msg);
            }
        }
    }
public function handleEvent(Event $event, Queue $queue)
    {
        if ($event instanceof UserEvent) {
            $nick = $event->getNick();
            $channel = $event->getSource();
            $params = $event->getParams();
            $text = $params['text'];
            $matched = stripos($text, '8 ball') !== false;
            if ($matched) {
                $msg = $nick . ', the magic 8 ball says "' . $this->getMagicEightBallAnswer() . '"';
                $queue->ircPrivmsg($channel, $msg);
            }
        }
    }
public function handleEvent ( Event $ event , Queue $ queue ) { if ( $ event instanceof UserEvent ) { $ nick = $ event -> getNick ( ) ; $ channel = $ event -> getSource ( ) ; $ params = $ event -> getParams ( ) ; $ text = $ params [ 'text' ] ; $ matched = stripos ( $ text , '8 ball' ) !== false ; if ( $ matched ) { $ msg = $ nick . ', the magic 8 ball says "' . $ this -> getMagicEightBallAnswer ( ) . '"' ; $ queue -> ircPrivmsg ( $ channel , $ msg ) ; } } }
Responds with a magic eight ball phrase when asked questions

@param \Phergie\Irc\Event\EventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
Responds with a magic eight ball phrase when asked questions