コード例 #1
0
 /**
  * @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));
 }
コード例 #2
0
 public function start()
 {
     $this->loop = \WyriHaximus\PhergieBot\loopResolver();
     EventManager::instance()->dispatch(ConstructEvent::create($this->loop));
     $this->loop->run();
 }