DiscordGateway
DiscordGateway is an internal class responsible for managing communication with the Discord API. This class handles rate limiting, scheduling HTTP requests, and processing events.
Properties
discordScheduler
gatewayEventIn
reporter
endpointRateLimits
{ [string]: HTTPRatelimit.HTTPRatelimit } }
endpointCaches
{ [string]: { [any]: any } }
Methods
parseErrors
DiscordGateway : parseErrors () -> string
errorTable: table
source: string?
depth: number?
Parses error messages from the Discord API response.
parseDiscordAPIErrors
DiscordGateway : parseDiscordAPIErrors () -> string
api: string
networkResponse: Net.FetchResponse
Parses errors from a Discord API response.
requestAsync
DiscordGateway : requestAsync () -> Vendor.Future
api: string
method: string
data: table?
Sends an asynchronous request to the Discord API.
getAsync
DiscordGateway : getAsync () -> Vendor.Future
api: string
headers: {
{ [string]: string } }
Sends an asynchronous GET request to the Discord API.
postAsync
DiscordGateway : postAsync () -> Vendor.Future
api: string
data: table
headers: {
{ [string]: string } }
Sends an asynchronous POST request to the Discord API.
putAsync
DiscordGateway : putAsync () -> Vendor.Future
api: string
data: table
headers: {
{ [string]: string } }
Sends an asynchronous PUT request to the Discord API.
deleteAsync
DiscordGateway : deleteAsync () -> Vendor.Future
api: string
data: table?
headers: {
{ [string]: string } }
Sends an asynchronous DELETE request to the Discord API.
patchAsync
DiscordGateway : patchAsync () -> Vendor.Future
api: string
data: table
headers: {
{ [string]: string } }
Sends an asynchronous PATCH request to the Discord API.
setEndpointCache
DiscordGateway : setEndpointCache () -> ()
endpoint: string
cache: table
Sets the cache for a specific API endpoint.
getEndpointCache
DiscordGateway : getEndpointCache () -> table
endpoint: string
Gets the cache for a specific API endpoint.
getApiVersion
DiscordGateway : getApiVersion () -> number
Gets the current Discord API version.
Functions
new
DiscordGateway . new () -> ()
discordClient: any
Creates a new instance of DiscordGateway.