public function transferOwnership($member)
    {
        $deferred = new Deferred();

        if ($member instanceof Member) {
            $member = $member->id;
        }

        $this->http->patch(
            $this->replaceWithVariables('guilds/:id'),
            [
                'owner_id' => $member,
            ]
        )->then(
            function ($response) use ($member, $deferred) {
                if ($response->owner_id != $member) {
                    $deferred->reject(new \Exception('Ownership was not transferred correctly.'));
                    $this->fill((array) $response);
                } else {
                    $deferred->resolve();
                }
            },
            \React\Partial\bind_right($this->reject, $deferred)
        );

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

        if ($member instanceof Member) {
            $member = $member->id;
        }

        $this->http->patch(
            $this->replaceWithVariables('guilds/:id'),
            [
                'owner_id' => $member,
            ]
        )->then(
            function ($response) use ($member, $deferred) {
                if ($response->owner_id != $member) {
                    $deferred->reject(new \Exception('Ownership was not transferred correctly.'));
                    $this->fill((array) $response);
                } else {
                    $deferred->resolve();
                }
            },
            \React\Partial\bind_right($this->reject, $deferred)
        );

        return $deferred->promise();
    }
public function transferOwnership ( $ member ) { $ deferred = new Deferred ( ) ; if ( $ member instanceof Member ) { $ member = $ member -> id ; } $ this -> http -> patch ( $ this -> replaceWithVariables ( 'guilds/:id' ) , [ 'owner_id' => $ member , ] ) -> then ( function ( $ response ) use ( $ member , $ deferred ) { if ( $ response -> owner_id != $ member ) { $ deferred -> reject ( new \ Exception ( 'Ownership was not transferred correctly.' ) ) ; $ this -> fill ( ( array ) $ response ) ; } else { $ deferred -> resolve ( ) ; } } , \ React \ Partial \ bind_right ( $ this -> reject , $ deferred ) ) ; return $ deferred -> promise ( ) ; }
Transfers ownership of the guild to
another member.

@param Member|int $member The member to transfer ownership to.

@return \React\Promise\Promise
Transfers ownership of the guild to another member .