From 412a117e15e49149af077c4dd300202c85b3c25a Mon Sep 17 00:00:00 2001 From: stringsplit <77242831+nbitzz@users.noreply.github.com> Date: Thu, 30 Nov 2023 19:20:54 +0000 Subject: [PATCH] node-fetch conversion --- src/server/lib/DiscordAPI/DiscordRequests.ts | 2 ++ src/server/lib/DiscordAPI/index.ts | 1 + 2 files changed, 3 insertions(+) diff --git a/src/server/lib/DiscordAPI/DiscordRequests.ts b/src/server/lib/DiscordAPI/DiscordRequests.ts index 9dd4e24..365395a 100644 --- a/src/server/lib/DiscordAPI/DiscordRequests.ts +++ b/src/server/lib/DiscordAPI/DiscordRequests.ts @@ -1,3 +1,5 @@ +import fetch, { type RequestInit, type Response, Headers } from "node-fetch" + const base = "https://discord.com/api/v10" const buckets = new Map() const routeConnections = new Map() diff --git a/src/server/lib/DiscordAPI/index.ts b/src/server/lib/DiscordAPI/index.ts index b31eca5..eeed066 100644 --- a/src/server/lib/DiscordAPI/index.ts +++ b/src/server/lib/DiscordAPI/index.ts @@ -1,5 +1,6 @@ import { REST } from "./DiscordRequests" import type { APIMessage } from "discord-api-types/v10" +import { FormData } from "node-fetch" const EXPIRE_AFTER = 20 * 60 * 1000 const DISCORD_EPOCH = 1420070400000