當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Services::getChannelManager方法代碼示例

本文整理匯總了PHP中Services::getChannelManager方法的典型用法代碼示例。如果您正苦於以下問題:PHP Services::getChannelManager方法的具體用法?PHP Services::getChannelManager怎麽用?PHP Services::getChannelManager使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Services的用法示例。


在下文中一共展示了Services::getChannelManager方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: part

 /**
  * Removes the bot from given channel
  * @param	string	$channel
  */
 public function part($channel, $message = "Leaving")
 {
     // join channel
     Services::getConnection()->getProtocol()->part($this->getUuid(), $channel, $message);
     // notify channel manager
     $chan = Services::getChannelManager()->getChannel($channel);
     $chan->part($this->getUuid());
 }
開發者ID:Evil-Co-Legacy,項目名稱:Evil-Co.de-Services,代碼行數:12,代碼來源:Bot.class.php

示例2: execute

 /**
  * @see lib/modules/CommandModule::execute()
  */
 public function execute($user, $target, $message)
 {
     // split message
     $messageEx = explode(' ', $message);
     if ($target[0] != '#') {
         $target = $messageEx[1];
         unset($messageEx[1]);
         $messageEx = array_values($messageEx);
     }
     if ($this->bot->isRegistered($target)) {
         return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.alreadyRegistered'));
     }
     $users = Services::getChannelManager()->getChannel($target)->getUserList();
     foreach ($users as $channelUser) {
         if ($channelUser['user']->getUuid() == $user->getUuid()) {
             if (stripos($channelUser['mode'], 'o')) {
                 $this->bot->register($target, Services::getUserManager()->getUser($user->getUuid())->accountname);
                 Services::getConnection()->getProtocol()->sendMode($this->bot->getUuid(), $target, '+q ' . $user->getNick());
                 return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.success', $target));
             }
         }
     }
     return $this->bot->sendMessage($user->getUuid(), Services::getLanguage()->get($user->languageID, 'command.' . $this->originalName . '.noOp'));
 }
開發者ID:Evil-Co-Legacy,項目名稱:Evil-Co.de-Services,代碼行數:27,代碼來源:CommandCregister.class.php

示例3: PART

 /**
  * Handles PART command
  *
  * @param	string		$input
  * @param	array<string>	$inputEx
  * @return	void
  */
 public static function PART($input, $inputEx)
 {
     Services::getEvent()->fire(Services::getConnection()->getProtocol(), 'userParted', array('channel' => $inputEx[2], 'user' => Services::getUserManager()->getUser($inputEx[0])));
     Services::getChannelManager()->getChannel($inputEx[2])->part($inputEx[0]);
 }
開發者ID:Evil-Co-Legacy,項目名稱:Evil-Co.de-Services,代碼行數:12,代碼來源:ProtocolHandler.class.php

示例4: handleLine

 /**
  * Notifies bots if a new messages received
  * @param	UserType	$user
  * @param	string		$target
  * @param	string	$message
  */
 public function handleLine($user, $target, $message)
 {
     if ($target[0] != '#') {
         foreach ($this->runningBots as $key => $bot) {
             if ($this->runningBots[$key]->getBot()->getUuid() == $target) {
                 $this->runningBots[$key]->handleLine($user, $target, $message);
             }
         }
     } else {
         $trigger = $message[0];
         $message = substr($message, 1);
         foreach ($this->runningBots as $key => $bot) {
             if (strtolower($this->runningBots[$key]->getTrigger()) == strtolower($trigger) and Services::getChannelManager()->getChannel($target)->isJoined($this->runningBots[$key]->getUuid())) {
                 $this->runningBots[$key]->handleLine($user, $target, $message);
             }
         }
     }
 }
開發者ID:Evil-Co-Legacy,項目名稱:Evil-Co.de-Services,代碼行數:24,代碼來源:ModuleManager.class.php


注:本文中的Services::getChannelManager方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。