public function ban($daysToDeleteMessasges = null)
    {
        $deferred = new Deferred();
        $content  = [];

        $url = $this->replaceWithVariables('guilds/:guild_id/bans/:id');

        if (! is_null($daysToDeleteMessasges)) {
            $content['delete-message-days'] = $daysToDeleteMessasges;
        }

        $this->http->put($url, $content)->then(
            function () use ($deferred) {
                $ban = $this->factory->create(Ban::class, [
                    'user'  => $this->user,
                    'guild' => $this->discord->guilds->get('id', $this->guild_id),
                ], true);

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

        return $deferred->promise();
    }
public function ban($daysToDeleteMessasges = null)
    {
        $deferred = new Deferred();
        $content  = [];

        $url = $this->replaceWithVariables('guilds/:guild_id/bans/:id');

        if (! is_null($daysToDeleteMessasges)) {
            $content['delete-message-days'] = $daysToDeleteMessasges;
        }

        $this->http->put($url, $content)->then(
            function () use ($deferred) {
                $ban = $this->factory->create(Ban::class, [
                    'user'  => $this->user,
                    'guild' => $this->discord->guilds->get('id', $this->guild_id),
                ], true);

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

        return $deferred->promise();
    }
public function ban ( $ daysToDeleteMessasges = null ) { $ deferred = new Deferred ( ) ; $ content = [ ] ; $ url = $ this -> replaceWithVariables ( 'guilds/:guild_id/bans/:id' ) ; if ( ! is_null ( $ daysToDeleteMessasges ) ) { $ content [ 'delete-message-days' ] = $ daysToDeleteMessasges ; } $ this -> http -> put ( $ url , $ content ) -> then ( function ( ) use ( $ deferred ) { $ ban = $ this -> factory -> create ( Ban :: class , [ 'user' => $ this -> user , 'guild' => $ this -> discord -> guilds -> get ( 'id' , $ this -> guild_id ) , ] , true ) ; $ deferred -> resolve ( $ ban ) ; } , \ React \ Partial \ bind_right ( $ this -> reject , $ deferred ) ) ; return $ deferred -> promise ( ) ; }
Bans the member.

@param int $daysToDeleteMessasges The amount of days to delete messages from.

@return \React\Promise\Promise
Bans the member .