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