refactor: remove RequestManager and use runMethod() (#732)

* fix(rest/process_request): use DiscordHTTPResponseCodes

* refactor: remove RequestManager

* refactor: remove RequestManager and use runMethod()
This commit is contained in:
ayntee
2021-04-02 23:18:51 +04:00
committed by GitHub
parent ec9ceaab04
commit 5f1b82a4e8
106 changed files with 418 additions and 326 deletions
+1 -6
View File
@@ -6,10 +6,9 @@ import { processQueue } from "./process_queue.ts";
import { processRateLimitedPaths } from "./process_rate_limited_paths.ts";
import { processRequest } from "./process_request.ts";
import { processRequestHeaders } from "./process_request_headers.ts";
import { RequestManager } from "./request_manager.ts";
import { runMethod } from "./run_method.ts";
export const rest: RestCache = {
export const rest = {
/** 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(),
@@ -30,10 +29,6 @@ export const rest: RestCache = {
globallyRateLimited() {},
retriesMaxed() {},
},
// TODO: add propeer docs dcomments
manager: RequestManager,
/** Handler function for every request. Converts to json, verified authorization & requirements and begins processing the request */
handlePayload,
checkRateLimits,