bothy-sdk
    Preparing search index...

    Function cardMessage

    • Builds the MessageCreate body of a card: kind: card, a new client_msg_id (UUIDv7) and the checked components. Use it where a message is posted without the outbox (for example from a browser); an adapter sends cards through Outbox.sendMessage with kind: "card", which stores the ID before the first send.

      Parameters

      • contentMd: string

        The Markdown text shown with the card.

      • list: readonly {}[]

        The components, for example of approvalCard.

      • options: CardMessageOptions = {}

        The run, the message it answers and the settings.

      Returns {}

      The request body of createMessage.

      RangeError for no components or a card outside the limits of checkComponents.

      const body = cardMessage("Allow the refund?", approvalCard(), { runId });
      await api.POST("/threads/{thread_id}/messages", { params: { path: { thread_id } }, body });