From 5ae0581c3c23b92fb4f6d3e0a630dc884bc59b28 Mon Sep 17 00:00:00 2001 From: Taureon <45183108+Taureon@users.noreply.github.com> Date: Sat, 14 Mar 2026 15:05:38 +0000 Subject: [PATCH] fix: Client.uploadFile: restrict tags to those specified in the api Signed-off-by: Taureon <45183108+Taureon@users.noreply.github.com> --- src/Client.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Client.ts b/src/Client.ts index 3119525c..38988239 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -41,6 +41,8 @@ import { RE_SPOILER, } from "./lib/regex.js"; +export type Tag = "attachments" | "avatars" | "backgrounds" | "icons" | "banners" | "emojis"; + export type Session = { _id: string; token: string; user_id: string } | string; /** @@ -555,9 +557,10 @@ export class Client extends AsyncEventEmitter { * @param tag Tag * @param file File * @param uploadUrl Media server upload route + * @returns File ID */ async uploadFile( - tag: string, + tag: Tag, file: File, uploadUrl?: string, ): Promise {