node-fetch conversion

This commit is contained in:
May 2023-11-30 19:20:54 +00:00 committed by GitHub
parent 7654801e41
commit 412a117e15
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 0 deletions

View file

@ -1,3 +1,5 @@
import fetch, { type RequestInit, type Response, Headers } from "node-fetch"
const base = "https://discord.com/api/v10" const base = "https://discord.com/api/v10"
const buckets = new Map<string, DiscordAPIBucket>() const buckets = new Map<string, DiscordAPIBucket>()
const routeConnections = new Map<string, DiscordAPIBucket>() const routeConnections = new Map<string, DiscordAPIBucket>()

View file

@ -1,5 +1,6 @@
import { REST } from "./DiscordRequests" import { REST } from "./DiscordRequests"
import type { APIMessage } from "discord-api-types/v10" import type { APIMessage } from "discord-api-types/v10"
import { FormData } from "node-fetch"
const EXPIRE_AFTER = 20 * 60 * 1000 const EXPIRE_AFTER = 20 * 60 * 1000
const DISCORD_EPOCH = 1420070400000 const DISCORD_EPOCH = 1420070400000