Module

x/discordeno/rest/mod.ts

Discord API library for Deno
Go to Latest
import * as mod from "https://dotland.deno.dev/x/discordeno@13.0.0-rc45/rest/mod.ts";

Functions

Check the rate limits for a url or a bucket.

Cleans up the queues by checking if there is nothing left and removing it.

Creates the request body and headers that are necessary to send a request. Will handle different types of methods and everything necessary for discord.

Processes the queue by looping over each path separately until the queues are empty.

This will create a infinite loop running in 1 seconds using tail recursion to keep rate limits clean. When a rate limit resets, this will remove it so the queue can proceed.

Processes a request and assigns it to a queue or creates a queue if none exists for it.

Processes the rate limit headers and determines if it needs to be rate limited and returns the bucket id if available

Split a url to separate rate limit buckets based on major/minor parameters.