livelike logo
Options
All
  • Public
  • Public/Protected
  • All
Menu

Index

Functions

Const addMessageListener

  • addMessageListener(arg: { roomId: string }, callback: Function): Promise<void>
  • Adds a listener to a chatroom that calls passed callback function when event fires.

    since

    1.18.0

    example
    addMessageListener({roomId: string}, function(e){console.log(e)})
    

    Parameters

    • arg: { roomId: string }
      • roomId: string
    • callback: Function

    Returns Promise<void>

Const getMessageCount

  • getMessageCount(roomId: string, time?: { since: string | number | Date }): Promise<IMessageCount>
  • getMessageCount Returns number of messages in chat room

    async
    example
    messageCount('c1f6082c-f7b9-4d1e-b64e-9071a3860ffc', {since: "2020-04-16T16:29:39.158Z"}).then(r => console.log(r.count))
    

    Parameters

    • roomId: string
    • Optional time: { since: string | number | Date }
      • since: string | number | Date

        Time to get messages since

    Returns Promise<IMessageCount>

Const getMessageList

  • getMessageList Returns array of message objects

    async
    example
    messageList({roomId: string}).then(list => console.log(list))
    

    Parameters

    Returns Promise<IMessageListPayload>

Const prepareOutgoingChatMessage

Const removeMessageListener

  • Removes listener from chatroom

    since

    1.18.0

    example
    removeMessageListener({roomId: string}, function(e){console.log(e)})
    

    Parameters

    Returns Promise<void>

Const sendCustomMessage

  • sendCustomMessage Send custom message to chat room.

    async
    example
    sendCustomMessage({custom_data: 'Test message', roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'})
    

    Parameters

    Returns Promise<any>

Const sendMessage

  • sendMessage Send user message to chat room.

    async
    example
    sendMessage({message: 'Test message', roomId: 'c1f6082c-f7b9-4d1e-b64e-9071a3860ffc'})
    

    Parameters

    Returns Promise<IMessagePayload>

Legend

  • Variable
  • Function
  • Function with type parameter
  • Type alias
  • Type alias with type parameter
  • Interface
  • Interface with type parameter
  • Enumeration

Generated using TypeDoc