当前位置: 首页>>代码示例>>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;未经允许,请勿转载。