Class LivechatThread

Hierarchy

Constructors

Properties

idOnExternalPlatform: ThreadIdOnExternalPlatform

Methods

  • Returns void

  • Set thread as archived

    Throws

    ArchiveThreadFailedError

    • This exception is thrown when the archive thread failed.

    Returns Promise<true>

    Promise true

  • 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

  • Recover existing live chat

    Throws

    ThreadRecoverFailedError

    • This exception is thrown when the recover fails or the thread does not exist.

    Returns Promise<ThreadRecoveredData>

    Promise ThreadRecoveredData

  • Send attachment

    Raw function to send attachments

    Throws

    UploadAttachmentError

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

    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>

  • Send message preview

    Parameters

    • text: string

      text

    Returns Promise<void>

  • Send Outbound Message

    Throws

    SendMessageFailedError

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

    Parameters

    • messageData: SendOutboundEventData

      message data

    Returns Promise<MessageSuccessEventData>

  • 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

    Example

    { indentName: 'value' }
    

    Parameters

    • customFields: CustomFieldsObject

      custom fields object

    Returns Promise<void>

  • Set thread name

    Throws

    SetThreadNameFailedError

    • This exception is thrown when the set thread name failed.

    Parameters

    • name: string

      New name of the Thread

    Returns Promise<true>

    Promise true

  • 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