function handleRatelimit(?int $limit, ?int $remaining, ?float $resetTime) {
        return $this->get()->then(function ($data) use ($limit, $remaining, $resetTime) {
            if($limit === null && $remaining === null && $resetTime === null) {
                $limit = $data['limit'];
                $remaining = $data['remaining'] + 1; // there is no ratelimit...
                $resetTime = $data['resetTime'];
            } else {
                $limit = $limit ?? $data['limit'];
                $remaining = $remaining ?? $data['remaining'];
                $resetTime = $resetTime ?? $data['resetTime'];
            }
            
            if($remaining === 0 && $resetTime > \microtime(true)) {
                $this->api->client->emit('debug', 'Endpoint "'.$this->endpoint.'" ratelimit encountered, continueing in '.($resetTime - \microtime(true)).' seconds');
            }
            
            return $this->set(array('limit' => $limit, 'remaining' => $remaining, 'resetTime' => $resetTime));
        });
    }
function handleRatelimit(?int $limit, ?int $remaining, ?float $resetTime) {
        return $this->get()->then(function ($data) use ($limit, $remaining, $resetTime) {
            if($limit === null && $remaining === null && $resetTime === null) {
                $limit = $data['limit'];
                $remaining = $data['remaining'] + 1; // there is no ratelimit...
                $resetTime = $data['resetTime'];
            } else {
                $limit = $limit ?? $data['limit'];
                $remaining = $remaining ?? $data['remaining'];
                $resetTime = $resetTime ?? $data['resetTime'];
            }
            
            if($remaining === 0 && $resetTime > \microtime(true)) {
                $this->api->client->emit('debug', 'Endpoint "'.$this->endpoint.'" ratelimit encountered, continueing in '.($resetTime - \microtime(true)).' seconds');
            }
            
            return $this->set(array('limit' => $limit, 'remaining' => $remaining, 'resetTime' => $resetTime));
        });
    }
function handleRatelimit ( ? int $ limit , ? int $ remaining , ? float $ resetTime ) { return $ this -> get ( ) -> then ( function ( $ data ) use ( $ limit , $ remaining , $ resetTime ) { if ( $ limit === null && $ remaining === null && $ resetTime === null ) { $ limit = $ data [ 'limit' ] ; $ remaining = $ data [ 'remaining' ] + 1 ; // there is no ratelimit... $ resetTime = $ data [ 'resetTime' ] ; } else { $ limit = $ limit ?? $ data [ 'limit' ] ; $ remaining = $ remaining ?? $ data [ 'remaining' ] ; $ resetTime = $ resetTime ?? $ data [ 'resetTime' ] ; } if ( $ remaining === 0 && $ resetTime > \ microtime ( true ) ) { $ this -> api -> client -> emit ( 'debug' , 'Endpoint "' . $ this -> endpoint . '" ratelimit encountered, continueing in ' . ( $ resetTime - \ microtime ( true ) ) . ' seconds' ) ; } return $ this -> set ( array ( 'limit' => $ limit , 'remaining' => $ remaining , 'resetTime' => $ resetTime ) ) ; } ) ; }
Sets the ratelimits from the response
@param int|null    $limit
@param int|null    $remaining
@param float|null  $resetTime  Reset time in seconds with milliseconds.
@return \React\Promise\ExtendedPromiseInterface|void
Sets the ratelimits from the response