From 4a6b8c9f263d79fc7bd137fa78884e8422baa0d0 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Wed, 15 Jun 2022 17:03:13 +0000 Subject: [PATCH] fix: remove rest object(v12 or v11 stuff) --- rest/rest.ts | 58 ---------------------------------------------------- 1 file changed, 58 deletions(-) diff --git a/rest/rest.ts b/rest/rest.ts index a8d32e0ad..7b189ae5d 100644 --- a/rest/rest.ts +++ b/rest/rest.ts @@ -1,61 +1,3 @@ -// deno-lint-ignore-file no-unused-vars -import { checkRateLimits } from "./checkRateLimits.ts"; -import { cleanupQueues } from "./cleanupQueues.ts"; -import { createRequestBody } from "./createRequestBody.ts"; -import { processQueue } from "./processQueue.ts"; -import { processRateLimitedPaths } from "./processRateLimitedPaths.ts"; -import { processRequest } from "./processRequest.ts"; -import { processRequestHeaders } from "./processRequestHeaders.ts"; -import { runMethod } from "./runMethod.ts"; -import { runProxyMethod } from "./runProxyMethod.ts"; -import { simplifyUrl } from "./simplifyUrl.ts"; -import { convertRestError } from "./convertRestError.ts"; - -export const rest = { - /** The bot token for this rest client. */ - token: "", - /** The maximum amount of retries allowed */ - maxRetryCount: 10, - apiVersion: "9", - /** The secret authorization key to confirm that this was a request made by you and not a DDOS attack. */ - authorization: "discordeno_best_lib_ever", - pathQueues: new Map< - string, - { - request: RestRequest; - payload: RestPayload; - }[] - >(), - processingQueue: false, - processingRateLimitedPaths: false, - globallyRateLimited: false, - rateLimitedPaths: new Map(), - eventHandlers: { - // BY DEFAULT WE WILL LOG ALL ERRORS TO CONSOLE. USER CAN CHOOSE TO OVERRIDE - error: function (...args: unknown[]) {}, - // PLACEHOLDERS TO ALLOW USERS TO CUSTOMIZE - debug: function (type: string, error: string | Record) {}, - fetching(payload: RestPayload) {}, - fetched(payload: RestPayload) {}, - fetchSuccess(payload: RestPayload) {}, - fetchFailed(payload: RestPayload, error: unknown) {}, - globallyRateLimited(url: string, resetsAt: number) {}, - retriesMaxed(payload: RestPayload) {}, - }, - /** Handler function for every request. Converts to json, verified authorization & requirements and begins processing the request */ - checkRateLimits, - cleanupQueues, - processQueue, - processRateLimitedPaths, - processRequestHeaders, - processRequest, - createRequestBody, - runMethod, - runProxyMethod, - simplifyUrl, - convertRestError, -}; - export interface RestRequest { url: string; method: string;