Class Requester

java.lang.Object
net.dv8tion.jda.internal.requests.Requester

public class Requester extends Object
  • Field Details

    • LOG

      public static final org.slf4j.Logger LOG
    • EMPTY_BODY

      public static final okhttp3.RequestBody EMPTY_BODY
    • MEDIA_TYPE_JSON

      public static final okhttp3.MediaType MEDIA_TYPE_JSON
    • MEDIA_TYPE_OCTET

      public static final okhttp3.MediaType MEDIA_TYPE_OCTET
    • MEDIA_TYPE_PNG

      public static final okhttp3.MediaType MEDIA_TYPE_PNG
    • MEDIA_TYPE_GIF

      public static final okhttp3.MediaType MEDIA_TYPE_GIF
  • Constructor Details

  • Method Details

    • setContextReady

      public void setContextReady(boolean ready)
    • setContext

      public void setContext()
    • getJDA

      public JDAImpl getJDA()
    • request

      public <T> void request(Request<T> apiRequest)
    • execute

      public okhttp3.Response execute(net.dv8tion.jda.internal.requests.Requester.WorkTask task)
    • execute

      public okhttp3.Response execute(net.dv8tion.jda.internal.requests.Requester.WorkTask task, boolean handleOnRateLimit)
      Used to execute a Request. Processes request related to provided bucket.
      Parameters:
      task - The API request that needs to be sent
      handleOnRateLimit - Whether to forward rate-limits, false if rate limit handling should take over
      Returns:
      Non-null if the request was ratelimited. Returns a Long containing retry_after milliseconds until the request can be made again. This could either be for the Per-Route ratelimit or the Global ratelimit.
      Check if globalCooldown is null to determine if it was Per-Route or Global.
    • execute

      public okhttp3.Response execute(net.dv8tion.jda.internal.requests.Requester.WorkTask task, boolean retried, boolean handleOnRatelimit)
    • getHttpClient

      public okhttp3.OkHttpClient getHttpClient()
    • getRateLimiter

      public RestRateLimiter getRateLimiter()
    • setRetryOnTimeout

      public void setRetryOnTimeout(boolean retryOnTimeout)
    • stop

      public void stop(boolean shutdown, Runnable callback)