From bd14075c8a9d6665bd0a1fd06bcb483753023d76 Mon Sep 17 00:00:00 2001 From: ayntee Date: Mon, 8 Mar 2021 18:12:35 +0400 Subject: [PATCH] fix(types/channel): change FileContent.blob type to Blob (#509) * fix(types/channel): change FileContent.blob type to Blob * idk * change to blob * idk --- src/interactions/types/webhook.ts | 2 +- src/rest/request_manager.ts | 2 +- src/types/api/message.ts | 2 +- src/types/channel.ts | 2 +- src/types/webhook.ts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/interactions/types/webhook.ts b/src/interactions/types/webhook.ts index 9743bb8b9..0a65112a6 100644 --- a/src/interactions/types/webhook.ts +++ b/src/interactions/types/webhook.ts @@ -12,7 +12,7 @@ export interface ExecuteWebhookOptions { /** true if this is a TTS message */ tts?: boolean; /** file contents the contents of the file being sent one of content, file, embeds */ - file?: { blob: unknown; name: string }; + file?: { blob: Blob; name: string }; /** array of up to 10 embed objects embedded rich content. */ embeds?: Embed[]; /** allowed mentions for the message */ diff --git a/src/rest/request_manager.ts b/src/rest/request_manager.ts index af77cb559..02e12b6a9 100644 --- a/src/rest/request_manager.ts +++ b/src/rest/request_manager.ts @@ -166,7 +166,7 @@ function createRequestBody(body: any, method: RequestMethods) { body.file.map((file: FileContent, index: number) => // The key of the form data item must be unique; otherwise, Discordeno only considers the first item in the form data with the same names - form.append(`file${index + 1}`, file.blob as Blob, file.name) + form.append(`file${index + 1}`, file.blob, file.name) ); form.append("payload_json", JSON.stringify({ ...body, file: undefined })); diff --git a/src/types/api/message.ts b/src/types/api/message.ts index d05de3392..a85eaec80 100644 --- a/src/types/api/message.ts +++ b/src/types/api/message.ts @@ -250,7 +250,7 @@ export interface DiscordCreateMessageParams { /** `true` if this is a TTS message */ tts: boolean; /** the contents of the file being sent */ - file?: { blob: unknown; name: string }; + file?: { blob: Blob; name: string }; /** embedded rich content */ embed?: DiscordEmbed; /** JSON encoded body of any additional request fields. */ diff --git a/src/types/channel.ts b/src/types/channel.ts index 5c0716f11..5113da665 100644 --- a/src/types/channel.ts +++ b/src/types/channel.ts @@ -123,7 +123,7 @@ export interface MessageContent { } export interface FileContent { - blob: unknown; + blob: Blob; name: string; } diff --git a/src/types/webhook.ts b/src/types/webhook.ts index bc52309f9..77932cbea 100644 --- a/src/types/webhook.ts +++ b/src/types/webhook.ts @@ -57,7 +57,7 @@ export interface ExecuteWebhookOptions { /** true if this is a TTS message */ tts?: boolean; /** file contents the contents of the file being sent one of content, file, embeds */ - file?: { blob: unknown; name: string }; + file?: { blob: Blob; name: string }; /** array of up to 10 embed objects embedded rich content. */ embeds?: Embed[]; /** allowed mentions for the message */