Ejemplo n.º 1
0
 /**
  * Here we process each individual message if it matches the right user and
  * channel. If so we can send it to the specific module to process it.
  *
  * @param  Bot          $pBot
  * @param  string $channel
  * @param  string $sNickname
  * @param  string $message
  */
 public function onChannelPrivmsg(Bot $pBot, $sChannel, $sNickname, $sMessage)
 {
     if ($sChannel[0] == '+' || $sChannel[0] == '%' || $sChannel[0] == '@' || $sChannel[0] == '&' || $sChannel[0] == '~') {
         $channel = substr($sChannel, 1);
     }
     $channel = strtolower($sChannel);
     $message = Util::stripFormat($sMessage);
     if ($channel == self::ECHO_CHANNEL || $channel == self::LOGGING_CHANNEL) {
         $pConfiguration = Configuration::getInstance();
         $aConfiguration = $pConfiguration->get('LVP');
         if (in_array($sNickname, $aConfiguration['NuwaniSistersEchoBots'])) {
             if ($message == '*** Global Gamemode Initialization') {
                 Seen::resetOnlinePlayersAtGamemodeInit();
                 Merchant::resetInformation();
             } else {
                 Seen::setPersonInformation($message);
                 Merchant::setInformation($message);
                 TempHistory::messageHandler($message);
                 if ($pBot['Nickname'] == 'Monique') {
                     QuoteDevice::setInformation($pBot, $message);
                 }
             }
         }
         if ($message == '!players') {
             Seen::syncOnlinePlayers();
         }
     }
     if ($channel == self::RADIO_CHANNEL && $sNickname == 'LVP_Radio') {
         Radio::setNowPlayingInformation($message);
     }
 }