feat(MessageAttachment): description (alt text) support (#6871)

Co-authored-by: D Trombett <maxtromb.dt@gmail.com>
This commit is contained in:
Jake Ward
2021-11-11 19:29:17 +00:00
committed by GitHub
parent 7630158f59
commit 5e0a7d51fc
5 changed files with 38 additions and 2 deletions

View File

@@ -50,8 +50,8 @@ class APIRequest {
let body;
if (this.options.files?.length) {
body = new FormData();
for (const file of this.options.files) {
if (file?.file) body.append(file.key ?? file.name, file.file, file.name);
for (const [index, file] of this.options.files.entries()) {
if (file?.file) body.append(file.key ?? `files[${index}]`, file.file, file.name);
}
if (typeof this.options.data !== 'undefined') {
if (this.options.dontUsePayloadJSON) {