public function getBotById($id) { if (!$this->connected) { return Promise\reject(new ConnectionException('Client not connected. Did you forget to call `connect()`?')); } if (!isset($this->bots[$id])) { return Promise\reject(new ApiException("No bot exists for ID '{$id}'.")); } return Promise\resolve($this->bots[$id]); }