Returns the AppState
which can be saved and reused
in future logins without needing the password.
This value indicates whether the API listens for events and is able to send messages.
This property is true if API.listen
method was invoked.
Establish the websocket connection and enables message sending and receiving.
Possible event names are error
, message
, typ
, presence
and close
.
Event emitter emitting all incoming events.
Closes the websocket connection and, consequently, disables message sending and receiving.
Sets a custom colour theme to a thread with threadId
.
⚠ Warning: threadId
parameter will change to enum soon
Sets a custom emoji to a thread with threadId
.
If you want to keep the original Facebook "like", set the emoji
argument as an empty string.
Changes the group chat title. This works only on groups.
Set a profile picture to a group with id threadId
.
Forwards a message with id messageID
to thread threadId
.
You can use this method to send an attachment without uploading it again.
Marks a thread with given threadId
as read.
Sends a message to a given thread.
Actual message object - can contain attachments, mentions, reply...
ID of a thread to send the message to
Sends a reaction to a message with id messageId
in a thread with threadId
.
An emoji to use in the reaction. The string must be exactly one emoji.
Sends a typing indicator to a thread with id threadId
.
the specified thread to send the indicator to
the actual state of typing indicator (typing or not typing)
time in milliseconds after which to turn off the typing state if the state is set to true - default 20000 (20 seconds)
Unsends the message with given messageId
, resulting in other participants not seeing the original content of the message.
Returns amount
of thread messages before the timestamp
(default undefined - last messages)
Returns all available information about a thread with threadId
.
Returns all available information about all user's friends as an array of user objects.
Event emitter emitting incoming messages. Set by
Api.listen()
method. Possible event names areerror
,message
,typ
,presence
andclose
.