diff --git a/assets/openapi.json b/assets/openapi.json index e90b59ff9..ab7f45532 100644 Binary files a/assets/openapi.json and b/assets/openapi.json differ diff --git a/assets/schemas.json b/assets/schemas.json index 8ff199c5c..77309deaf 100644 Binary files a/assets/schemas.json and b/assets/schemas.json differ diff --git a/src/schemas/api/messages/Attachments.ts b/src/schemas/api/messages/Attachments.ts index 4f82dc8ea..eb0d7194b 100644 --- a/src/schemas/api/messages/Attachments.ts +++ b/src/schemas/api/messages/Attachments.ts @@ -16,12 +16,46 @@ along with this program. If not, see . */ +import { PartialUser } from "@spacebar/schemas"; + export interface PublicAttachment { - filename: string; // name of file attached - size: number; // size of file in bytes - height?: number; // height of file (if image) - width?: number; // width of file (if image) + filename: string; + size: number; content_type?: string; url: string; - proxy_url: string; + proxy_url: string; // only relevant for images/video, but returns a 415 Unsupported Media Type for others, always included + description?: string; // alt text + flags?: AttachmentFlags; + + // image metadata + height?: number; + width?: number; + + // content scanning + content_scan_version?: number; + + // thumbhash - https://github.com/evanw/thumbhash + placeholder_version?: number; + placeholder?: string; + + // voice messages + duration_secs?: number; + waveform?: string; // base64 byte array + + // clips + title?: string; // clips only? Documentation kinda sucks... + clip_created_at?: Date; + clip_participants?: PartialUser[]; + // application?: PartialApplication[]; +} + +export enum AttachmentFlags { + IS_CLIP = 1 << 0, + IS_THUMBNAIL = 1 << 1, + IS_REMIX = 1 << 2, + IS_SPOILER = 1 << 3, + CONTAINS_EXPLICIT_MEDIA = 1 << 4, + IS_ANIMATED = 1 << 5, + CONTAINS_GORE_CONTENT = 1 << 6, + CONTAINS_SELF_HARM_CONTENT = 1 << 7, } diff --git a/src/schemas/uncategorised/MessageCreateSchema.ts b/src/schemas/uncategorised/MessageCreateSchema.ts index ed0387b4e..585b849ea 100644 --- a/src/schemas/uncategorised/MessageCreateSchema.ts +++ b/src/schemas/uncategorised/MessageCreateSchema.ts @@ -19,14 +19,28 @@ import { Snowflake } from "../Identifiers"; import { InteractionType, AllowedMentions, MessageReference, ApplicationCommandType, BaseMessageComponents, Embed, PollAnswer, PollMedia, PublicUser } from "@spacebar/schemas"; -export type MessageCreateAttachment = { - id: string; +export type BaseMessageCreateAttachment = { filename: string; + title?: string; // clips only? + description?: string; // alt text + duration_secs?: number; //flat + waveform?: string; //base64 byte array + + is_clip?: boolean; + is_thumbnail?: boolean; + is_remix?: boolean; + is_spoiler?: boolean; + + clip_created_at?: Date; + clip_participant_ids?: Snowflake[]; }; -export type MessageCreateCloudAttachment = { +export type MessageCreateAttachment = BaseMessageCreateAttachment & { + id: string; +}; + +export type MessageCreateCloudAttachment = BaseMessageCreateAttachment & { id?: string; - filename: string; uploaded_filename: string; original_content_type?: string; };