fix(types/channel): change FileContent.blob type to Blob (#509)

* fix(types/channel): change FileContent.blob type to Blob

* idk

* change to blob

* idk
This commit is contained in:
ayntee
2021-03-08 18:12:35 +04:00
committed by GitHub
parent 100f7ff965
commit bd14075c8a
5 changed files with 5 additions and 5 deletions

View File

@@ -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 */

View File

@@ -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 }));

View File

@@ -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. */

View File

@@ -123,7 +123,7 @@ export interface MessageContent {
}
export interface FileContent {
blob: unknown;
blob: Blob;
name: string;
}

View File

@@ -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 */