Phergie\Irc\Bot\React\Bot::setClient PHP Method

setClient() public method

Sets the IRC client for the bot to use.
public setClient ( Phergie\Irc\Client\React\ClientInterface $client )
$client Phergie\Irc\Client\React\ClientInterface
    public function setClient(ClientInterface $client)
    {
        $this->registerClientSubscribers($client);
        $this->client = $client;
    }

Usage Example

 /**
  * @param ConstructEvent $event
  */
 public function construct(ConstructEvent $event)
 {
     $client = new Client();
     $client->setLoop($event->getLoop());
     $bot = new Bot();
     $bot->setConfig(Configure::read('WyriHaximus.Phergie.config'));
     $bot->setClient($client);
     $bot->run(false);
     EventManager::instance()->dispatch(StartEvent::create($event->getLoop(), $bot));
 }
All Usage Examples Of Phergie\Irc\Bot\React\Bot::setClient