Skip to content

Commit

Permalink
Update bundle based on commit 6a1f2b6
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions committed Mar 7, 2024
1 parent 381566c commit f746456
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions dist/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -477,14 +477,11 @@ try {
requestHeaders.append("Content-Type", "multipart/form-data");
const requestForm = new FormData();
for (let index = 0; index < files.length; index += 1) {
// const fileFullPath = pathJoin(ghactionsWorkspaceDirectory, files[index]);
attachments.push({
// "filename": pathBaseName(fileFullPath),
"filename": pathBaseName(files[index]),
"id": index
filename: pathBaseName(files[index]),
id: index
});
// requestForm.append(`files[${filesIndex}]`, fsCreateReadStream(fileFullPath));
requestForm.append(`files[${index}]`, new Blob([await fsReadFile(files[index])]));
requestForm.append(`files[${index}]`, new Blob([await fsReadFile(files[index])]), pathBaseName(files[index]));
}
requestForm.append("attachments", JSON.stringify(attachments));
requestForm.append("payload_json", requestPayloadStringify);
Expand All @@ -494,7 +491,7 @@ try {
requestHeaders.append("Content-Type", "application/json");
return requestPayloadStringify;
default:
throw new Error(`${method} is not a valid method!`);
throw new Error(`\`${method}\` is not a valid method!`);
}
})();
console.log(`Post network request to Discord.`);
Expand Down

0 comments on commit f746456

Please sign in to comment.