src/Plugin.php
public function processPrivmsg(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $source = $event->getSource();
        $nick = $event->getNick();
        if ($source === null || $nick === null || $source == $nick) {
            $logger->debug('Incoming PRIVMSG not in channel, ignoring');
            return;
        }

        $server = strtolower($event->getConnection()->getServerHostname());
        $channel = $source;
        $params = $event->getParams();
        $message = $params['text'];

        $logger->debug('Processing incoming PRIVMSG', array(
            'server' => $server,
            'channel' => $channel,
            'nick' => $nick,
            'message' => $message,
        ));

        try {
            $this->db->fetchAssoc(self::SQL_UPDATE, array(
                ':time' => time(),
                ':server' => $server,
                ':channel' => $channel,
                ':nick' => $nick,
                ':type' => self::TYPE_PRIVMSG,
                ':text' => $message,
            ));
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
        }
    }
public function processPrivmsg(UserEvent $event, Queue $queue)
    {
        $logger = $this->getLogger();

        $source = $event->getSource();
        $nick = $event->getNick();
        if ($source === null || $nick === null || $source == $nick) {
            $logger->debug('Incoming PRIVMSG not in channel, ignoring');
            return;
        }

        $server = strtolower($event->getConnection()->getServerHostname());
        $channel = $source;
        $params = $event->getParams();
        $message = $params['text'];

        $logger->debug('Processing incoming PRIVMSG', array(
            'server' => $server,
            'channel' => $channel,
            'nick' => $nick,
            'message' => $message,
        ));

        try {
            $this->db->fetchAssoc(self::SQL_UPDATE, array(
                ':time' => time(),
                ':server' => $server,
                ':channel' => $channel,
                ':nick' => $nick,
                ':type' => self::TYPE_PRIVMSG,
                ':text' => $message,
            ));
        } catch (\Exception $e) {
            $logger->error($e->getMessage());
        }
    }
public function processPrivmsg ( UserEvent $ event , Queue $ queue ) { $ logger = $ this -> getLogger ( ) ; $ source = $ event -> getSource ( ) ; $ nick = $ event -> getNick ( ) ; if ( $ source === null || $ nick === null || $ source == $ nick ) { $ logger -> debug ( 'Incoming PRIVMSG not in channel, ignoring' ) ; return ; } $ server = strtolower ( $ event -> getConnection ( ) -> getServerHostname ( ) ) ; $ channel = $ source ; $ params = $ event -> getParams ( ) ; $ message = $ params [ 'text' ] ; $ logger -> debug ( 'Processing incoming PRIVMSG' , array ( 'server' => $ server , 'channel' => $ channel , 'nick' => $ nick , 'message' => $ message , ) ) ; try { $ this -> db -> fetchAssoc ( self :: SQL_UPDATE , array ( ':time' => time ( ) , ':server' => $ server , ':channel' => $ channel , ':nick' => $ nick , ':type' => self :: TYPE_PRIVMSG , ':text' => $ message , ) ) ; } catch ( \ Exception $ e ) { $ logger -> error ( $ e -> getMessage ( ) ) ; } }
Monitor channel messages.

@param \Phergie\Irc\Event\UserEventInterface $event
@param \Phergie\Irc\Bot\React\EventQueueInterface $queue
Monitor channel messages .