diff --git a/common/constants.ts b/common/constants.ts index 1a7eab4ce..a8cfae60b 100644 --- a/common/constants.ts +++ b/common/constants.ts @@ -9,6 +9,7 @@ const domains = { scratch: "https://scratch.mit.edu", scratchAddons: "https://scratchaddons.com", scratchApi: "https://corsproxy.io/?https://api.scratch.mit.edu", + /** @deprecated */ scratchdb: "https://scratchdb.lefty.one/v3", } as const; diff --git a/modules/autos/scratch.ts b/modules/autos/scratch.ts index 3ea6cb75a..c5979b162 100644 --- a/modules/autos/scratch.ts +++ b/modules/autos/scratch.ts @@ -9,7 +9,6 @@ import { TimestampStyles, cleanCodeBlockContent, time, type APIEmbed } from "dis import { parser, type Node } from "posthtml-parser"; import constants from "../../common/constants.js"; import { escapeMessage } from "../../util/markdown.js"; -import { nth } from "../../util/numbers.js"; import { gracefulFetch } from "../../util/promises.js"; import { fetchUser } from "../../util/scratch.js"; import { truncateText } from "../../util/text.js"; @@ -133,69 +132,28 @@ export async function handleUser(urlParts: string[]): Promise(`${constants.domains.scratchdb}/user/info/${username}/`); - const scratchUser = - !user || "error" in user || !user.id ? - await gracefulFetch< - | { - id: number; - username: string; - scratchteam: boolean; - history: { joined: string; login?: string }; - profile: { - id: number; - avatar?: string; - images: { - "90x90": string; - "60x60": string; - "55x55": string; - "50x50": string; - "32x32": string; - }; - status: string; - bio: string; - country: string; - }; - } - | { code: string; message: string } - >(`${constants.domains.scratchApi}/users/${username}/`) - : user; - return !scratchUser || "code" in scratchUser || !scratchUser.id ? undefined : scratchUser; + | { code: string; message: string } + >(`${constants.domains.scratchApi}/users/${username}/`); + return !user || "code" in user ? undefined : user; }