Options
All
  • Public
  • Public/Protected
  • All
Menu

Module ChatApi

Index

Variables

Const SYMBOL

SYMBOL: symbol = BotyoSymbol.forName("ChatApi")

Methods

changeThreadColor

  • changeThreadColor(threadId: FacebookId, color: string): Promise<void>

getCurrentUserId

getThreadHistory

  • getThreadHistory(threadId: FacebookId, amount: number, timestamp?: undefined | number): Promise<Message[]>
  • Returns chat history for the thread indicated by threadId.

    since

    2.0.0

    Parameters

    • threadId: FacebookId

      The thread ID

    • amount: number

      The amount of messages to request

    • Optional timestamp: undefined | number

      Used to describe the time of the most recent message to load. If timestamp is undefined, facebook will load the most recent messages.

    Returns Promise<Message[]>

    promise with array of messages

getThreadInfo

getUserId

  • Given the full name or vanity name of a Facebook user, event, page, group or app, the call will perform a Facebook Graph search and return all corresponding IDs (order determined by Facebook).

    since

    2.0.0

    Parameters

    • name: string

    Returns Promise<UserIdSearchResult[]>

getUserInfo

handleMessageRequest

  • handleMessageRequest(threadId: FacebookId, shouldAccept: boolean): Promise<void>
  • Handles the message request for the specified thread ID.

    since

    2.0.0

    Parameters

    • threadId: FacebookId
    • shouldAccept: boolean

      whether to accept the request

    Returns Promise<void>

markAsRead

resolvePhotoUrl

  • resolvePhotoUrl(photoId: FacebookId): Promise<string>
  • Resolves the URL to the full-size photo, given its ID. This function is useful for retrieving the full-size photo URL of image attachments in messages, returned by getThreadHistory.

    since

    2.0.0

    Parameters

    Returns Promise<string>

sendMessage

sendTypingIndicator

setMessageReaction

  • setMessageReaction(messageId: string, reaction: Reaction | string): Promise<void>
  • Sets a reaction to a message.

    since

    2.0.0

    Parameters

    • messageId: string

      the message ID

    • reaction: Reaction | string

      the reaction

    Returns Promise<void>

Generated using TypeDoc