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

@@ -177,6 +177,16 @@ class MessagePayload {
}
}
const attachments = this.options.files?.map((file, index) => ({
id: index.toString(),
description: file.description,
}));
if (Array.isArray(this.options.attachments)) {
this.options.attachments.push(...attachments);
} else {
this.options.attachments = attachments;
}
this.data = {
content,
tts,