Type alias MessageContentBlock

MessageContentBlock: {
    type: "text";
    text: string;
} | {
    type: "image";
    url: string;
    caption?: string;
    mimeType?: string;
} | {
    type: "video";
    url: string;
    caption?: string;
    mimeType?: string;
} | {
    type: "audio";
    url: string;
    duration?: number;
    mimeType?: string;
} | {
    type: "document";
    url: string;
    filename: string;
    mimeType?: string;
} | {
    type: "sticker";
    stickerId: string;
    url?: string;
} | {
    type: "location";
    latitude: number;
    longitude: number;
    name?: string;
} | {
    type: "button_group";
    buttons: MessageButton[];
} | {
    type: "embed";
    title: string;
    description?: string;
    url?: string;
    color?: string;
    fields?: {
        name: string;
        value: string;
        inline?: boolean;
    }[];
} | {
    type: "poll";
    question: string;
    options: string[];
    durationHours?: number;
} | {
    type: "story";
    mediaUrl: string;
    caption?: string;
    stickers?: string[];
} | {
    type: "reel";
    videoUrl: string;
    caption?: string;
    audio?: string;
    hashtags?: string[];
} | {
    type: "carousel";
    items: {
        url: string;
        caption?: string;
        mimeType?: string;
    }[];
}

Content block within a message. A single message can contain multiple content blocks (e.g., text + image attachment).

Type declaration

  • type: "text"
  • text: string

Type declaration

  • type: "image"
  • url: string
  • Optional caption?: string
  • Optional mimeType?: string

Type declaration

  • type: "video"
  • url: string
  • Optional caption?: string
  • Optional mimeType?: string

Type declaration

  • type: "audio"
  • url: string
  • Optional duration?: number
  • Optional mimeType?: string

Type declaration

  • type: "document"
  • url: string
  • filename: string
  • Optional mimeType?: string

Type declaration

  • type: "sticker"
  • stickerId: string
  • Optional url?: string

Type declaration

  • type: "location"
  • latitude: number
  • longitude: number
  • Optional name?: string

Type declaration

Type declaration

  • type: "embed"
  • title: string
  • Optional description?: string
  • Optional url?: string
  • Optional color?: string
  • Optional fields?: {
        name: string;
        value: string;
        inline?: boolean;
    }[]

Type declaration

  • type: "poll"
  • question: string
  • options: string[]
  • Optional durationHours?: number

Type declaration

  • type: "story"
  • mediaUrl: string
  • Optional caption?: string
  • Optional stickers?: string[]

Type declaration

  • type: "reel"
  • videoUrl: string
  • Optional caption?: string
  • Optional audio?: string
  • Optional hashtags?: string[]

Type declaration

  • type: "carousel"
  • items: {
        url: string;
        caption?: string;
        mimeType?: string;
    }[]