public function getPrivateChannel()
    {
        $deferred = new Deferred();

        if ($this->cache->has("pm_channel.{$this->id}")) {
            $deferred->resolve($this->cache->get("pm_channel.{$this->id}"));
        } else {
            $this->http->post('users/@me/channels', ['recipient_id' => $this->id])->then(function ($response) use ($deferred) {
                $channel = $this->factory->create(Channel::class, $response, true);
                $this->cache->set("pm_channel.{$this->id}", $channel);

                $deferred->resolve($channel);
            }, \React\Partial\bind_right($this->reject, $deferred));
        }

        return $deferred->promise();
    }
public function getPrivateChannel()
    {
        $deferred = new Deferred();

        if ($this->cache->has("pm_channel.{$this->id}")) {
            $deferred->resolve($this->cache->get("pm_channel.{$this->id}"));
        } else {
            $this->http->post('users/@me/channels', ['recipient_id' => $this->id])->then(function ($response) use ($deferred) {
                $channel = $this->factory->create(Channel::class, $response, true);
                $this->cache->set("pm_channel.{$this->id}", $channel);

                $deferred->resolve($channel);
            }, \React\Partial\bind_right($this->reject, $deferred));
        }

        return $deferred->promise();
    }
public function getPrivateChannel ( ) { $ deferred = new Deferred ( ) ; if ( $ this -> cache -> has ( "pm_channel.{$this->id}" ) ) { $ deferred -> resolve ( $ this -> cache -> get ( "pm_channel.{$this->id}" ) ) ; } else { $ this -> http -> post ( 'users/@me/channels' , [ 'recipient_id' => $ this -> id ] ) -> then ( function ( $ response ) use ( $ deferred ) { $ channel = $ this -> factory -> create ( Channel :: class , $ response , true ) ; $ this -> cache -> set ( "pm_channel.{$this->id}" , $ channel ) ; $ deferred -> resolve ( $ channel ) ; } , \ React \ Partial \ bind_right ( $ this -> reject , $ deferred ) ) ; } return $ deferred -> promise ( ) ; }
Gets the private channel for the user.

@return \React\Promise\Promise
Gets the private channel for the user .