Class LivechatThread

Hierarchy

Constructors

Properties

idOnExternalPlatform: ThreadIdOnExternalPlatform

Methods

  • Returns void

  • Set thread as archived

    Returns Promise<true>

    Promise true

    Throws

    ArchiveThreadFailedError

    • This exception is thrown when the archive thread failed.
  • Returns Promise<void>

  • Send start and stop typing events. It sends stop typing event after the timeout. Repeated calls resets this timeout.

    Parameters

    • timeout: number = 1000

      The timeout in milliseconds.

    • Optional onSendCallback: (() => void)

      Callback to be called after the stop typing event is sent.

        • (): void
        • Returns void

    Returns void

  • Send typing event for message preview after the timeout.

    Parameters

    • currentText: string

      current text

    • timeout: number = 1250

      timeout in milliseconds

    Returns void

    void

  • Send attachment

    Raw function to send attachments

    Parameters

    • files: FileList

      An object of this type is returned by the files' property of the HTML element; this lets you access the list of files selected with the element.

    • options: SendMessageOptions = {}

      options

    Returns Promise<MessageSuccessEventData>

    Throws

    UploadAttachmentError

    • This exception is thrown when the file upload fails. The error.data contains information about allowed file size and types.
  • Send message preview

    Parameters

    • text: string

      text

    Returns Promise<void>

  • Send Outbound Message

    Parameters

    • messageData: SendOutboundEventData

      message data

    Returns Promise<MessageSuccessEventData>

    Throws

    SendMessageFailedError

    • This exception is thrown when a message fails to send. The error contains (error.data) a response from the backend with details.
  • Set thread custom field

    Parameters

    • name: string

      custom field name

    • value: null | string

      custom field value

    Returns Promise<void>

  • Set thread custom fields and send them

    Parameters

    • customFields: CustomFieldsObject

      custom fields object

    Returns Promise<void>

    Example

    { indentName: 'value' }
    
  • Set thread name

    Parameters

    • name: string

      New name of the Thread

    Returns Promise<true>

    Promise true

    Throws

    SetThreadNameFailedError

    • This exception is thrown when the set thread name failed.
  • Manually send the stop typing event and clear the keystroke timeout.

    Returns void

  • Manually send the stop typing event for message preview and clear the keystroke timeout.

    Parameters

    • shouldSendPreview: boolean = true

      should send preview

    Returns void

    void

Generated using TypeDoc