mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-15 11:03:30 +01:00
refactor(files): file data can be much more than buffer (#7238)
This commit is contained in:
@@ -28,7 +28,7 @@ export interface RawFile {
|
||||
/**
|
||||
* The actual data for the file
|
||||
*/
|
||||
rawBuffer: Buffer;
|
||||
fileData: string | number | boolean | Buffer;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -280,7 +280,7 @@ export class RequestManager extends EventEmitter {
|
||||
|
||||
// Attach all files to the request
|
||||
for (const [index, file] of request.files.entries()) {
|
||||
formData.append(file.key ?? `files[${index}]`, file.rawBuffer, file.fileName);
|
||||
formData.append(file.key ?? `files[${index}]`, file.fileData, file.fileName);
|
||||
}
|
||||
|
||||
// If a JSON body was added as well, attach it to the form data, using payload_json unless otherwise specified
|
||||
|
||||
Reference in New Issue
Block a user