Update message schema to handle cloud attachments
This commit is contained in:
parent
c167a7b541
commit
db765d8ff0
@ -93,6 +93,7 @@ router.post(
|
||||
id: a.userAttachmentId,
|
||||
upload_filename: a.uploadFilename,
|
||||
upload_url: `${cdnUrl}/attachments/${a.uploadFilename}`,
|
||||
original_content_type: a.userOriginalContentType
|
||||
}
|
||||
})} as UploadAttachmentResponseSchema);
|
||||
},
|
||||
|
||||
@ -16,12 +16,8 @@
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import {
|
||||
ActionRowComponent,
|
||||
Embed,
|
||||
PollAnswer,
|
||||
PollMedia,
|
||||
} from "@spacebar/util";
|
||||
import { ActionRowComponent, Embed, PollAnswer, PollMedia, UploadAttachmentResponse } from "@spacebar/util";
|
||||
import { CloudAttachment } from "../entities/CloudAttachment";
|
||||
|
||||
export type MessageCreateAttachment = {
|
||||
id: string;
|
||||
@ -57,7 +53,7 @@ export interface MessageCreateSchema {
|
||||
TODO: we should create an interface for attachments
|
||||
TODO: OpenWAAO<-->attachment-style metadata conversion
|
||||
**/
|
||||
attachments?: MessageCreateAttachment[];
|
||||
attachments?: (MessageCreateAttachment | UploadAttachmentResponse)[];
|
||||
sticker_ids?: string[];
|
||||
components?: ActionRowComponent[];
|
||||
// TODO: Fix TypeScript errors in src\api\util\handlers\Message.ts once this is enabled
|
||||
|
||||
@ -25,4 +25,5 @@ export interface UploadAttachmentResponse {
|
||||
id?: string;
|
||||
upload_url: string;
|
||||
upload_filename: string;
|
||||
original_content_type?: string;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user