public function createInvite($max_age = 3600, $max_uses = 0, $temporary = false, $xkcd = false)
    {
        $deferred = new Deferred();

        $this->http->post(
            $this->replaceWithVariables('channels/:id/invites'),
            [
                'validate' => null,

                'max_age'   => $max_age,
                'max_uses'  => $max_uses,
                'temporary' => $temporary,
                'xkcdpass'  => $xkcd,
            ]
        )->then(
            function ($response) use ($deferred) {
                $invite = $this->factory->create(Invite::class, $response, true);

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

        return $deferred->promise();
    }
public function createInvite($max_age = 3600, $max_uses = 0, $temporary = false, $xkcd = false)
    {
        $deferred = new Deferred();

        $this->http->post(
            $this->replaceWithVariables('channels/:id/invites'),
            [
                'validate' => null,

                'max_age'   => $max_age,
                'max_uses'  => $max_uses,
                'temporary' => $temporary,
                'xkcdpass'  => $xkcd,
            ]
        )->then(
            function ($response) use ($deferred) {
                $invite = $this->factory->create(Invite::class, $response, true);

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

        return $deferred->promise();
    }
public function createInvite ( $ max_age = 3600 , $ max_uses = 0 , $ temporary = false , $ xkcd = false ) { $ deferred = new Deferred ( ) ; $ this -> http -> post ( $ this -> replaceWithVariables ( 'channels/:id/invites' ) , [ 'validate' => null , 'max_age' => $ max_age , 'max_uses' => $ max_uses , 'temporary' => $ temporary , 'xkcdpass' => $ xkcd , ] ) -> then ( function ( $ response ) use ( $ deferred ) { $ invite = $ this -> factory -> create ( Invite :: class , $ response , true ) ; $ deferred -> resolve ( $ invite ) ; } , \ React \ Partial \ bind_right ( $ this -> reject , $ deferred ) ) ; return $ deferred -> promise ( ) ; }
Creates an invite for the channel.

@param int  $max_age   The time that the invite will be valid in seconds.
@param int  $max_uses  The amount of times the invite can be used.
@param bool $temporary Whether the invite is for temporary membership.
@param bool $xkcd      Whether to generate an XKCD invite.

@return \React\Promise\Promise
Creates an invite for the channel .