new Chat(opts)
Snapchat wrapper for chat-related API calls.
Parameters:
| Name | Type | Description |
|---|---|---|
opts |
Object |
- Source:
Methods
-
clearConversationWithIdentifier(identifier, cb)
-
Clears the conversation with the given identifier.
Parameters:
Name Type Description identifierstring The identifier of the conversation to clear.
cbfunction - Source:
-
clearFeed(cb)
-
Clears the entire feed.
Parameters:
Name Type Description cbfunction - Source:
-
conversationAuth(username, cb)
-
Retrieves the conversation auth mac and payload for a conversation with username.
Parameters:
Name Type Description usernamestring cbfunction - Source:
-
conversationsWithUsers(usernames, cb)
-
Fetches the conversations for all users in \e usernames
Parameters:
Name Type Description usernamesArray.<string> cbfunction - Source:
-
conversationWithUser(username, cb)
-
Retrieves the conversation with \e username.
Parameters:
Name Type Description usernamestring cbfunction - Source:
-
loadAllConversations(cb)
-
Loads all conversations into the current session.
This method will update client.session.conversations accordingly.
Parameters:
Name Type Description cbfunction - Source:
-
loadConversationsAfter(conversation, cb)
-
Loads another page of conversations in the feed after the given conversation.
This method will update client.session.conversations accordingly.
Parameters:
Name Type Description conversationConversation The conversation after which to load more conversations.
cbfunction - Source:
-
loadFullConversation(conversation, cb)
-
Loads all messages in the given thread and adds them to that Conversation object.
Parameters:
Name Type Description conversationConversation The conversation to load completely.
cbfunction - Source:
-
loadMessagesAfterPagination(messageOrTransaction, cb)
-
Loads more messages after the given message or cash transaction.
Parameters:
Name Type Description messageOrTransactionTransaction | Message any object conforming to Pagination \b EXCEPT AN \C Conversation.
cbfunction - Source:
-
markRead(conversation, cb)
-
Marks all chat messages in a conversation as read.
Parameters:
Name Type Description conversationConversation cbfunction - Source:
- To Do:
-
- currently not working
-
sendMessage(message, username, cb)
-
Sends a message \e message to \e username.
Parameters:
Name Type Description messagestring The message to send.
usernameArray.<string> The username of the recipient.
cbfunction - Source:
-
sendMessageToUsers(message, usernames, cb)
-
Sends a message \e message to each user in \e usernames.
Parameters:
Name Type Description messagestring The message to send.
usernamesArray.<string> An array of username strings as recipients.
cbfunction - Source:
-
sendTypingToUser(username, cb)
-
Sends the typing notification to a single user.
Parameters:
Name Type Description usernamestring cbfunction - Source:
-
sendTypingToUsers(recipients, cb)
-
Sends the typing notification to the given users.
Parameters:
Name Type Description recipientsArray.<string> An array of username strings.
cbfunction - Source: