DiscordRESTRequester

Inherits: Reference < Object

Description

Discord REST API requester, uses a rate limiter to queue requests.

Properties

type name
RESTRateLimiter limiter

Methods

return type signature
HTTPResponse request_async ( RestRequest request ) coroutine
Resource cdn_download_async ( String _url ) coroutine
int get_last_latency_ms ( )

Property Descriptions

Method Descriptions

  • DiscordRESTRequester DiscordRESTRequester ( bool use_pool=false )

    Constructs a new DiscordRESTRequester. use_pool specifies whether to use an HTTP connection pool (experimental unstable feature).


  • HTTPResponse request_async ( RestRequest request ) coroutine

    Sends a request to the Discord REST API asynchronously and returns an HTTPResponse object. Prints a human-readable error message in case of failure.


  • Resource cdn_download_async ( String _url ) coroutine

    Downloads a resource from the Discord REST API asynchronously.


  • int get_last_latency_ms ( )

    Gets the last request latency in milliseconds.