new MessageRepository()
Methods
messagesForChannel(parameters) → {LiveCollection}
Get messages from a channel.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Throws:
-
Will throw an error if parameters are wrong.
- Type
- EkoSDKInvalidParameterError
Returns:
The LiveCollection instance of message
models
.
- Type
- LiveCollection
messageForId(messageId) → {LiveObject}
Fetch a message
Parameters:
Name | Type | Description |
---|---|---|
messageId |
string | The message ID of the requested message. |
Returns:
The LiveObject instance of message
model
- Type
- LiveObject
createTextMessage(parameters) → {LiveObject}
Create a text message in channel.
Parameters:
Name | Type | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
parameters |
Object |
Properties
|
Throws:
-
Will throw an error if parameters are wrong.
- Type
- EkoSDKInvalidParameterError
Returns:
The LiveObject instance of
MessageModel
.
- Type
- LiveObject
flag(messageId) → {Promise.<undefined, EkoSDKError>}
Flag a message
Parameters:
Name | Type | Description |
---|---|---|
messageId |
String | The message ID of the message to be flagged. |
Throws:
-
Will throw an error if parameters are wrong.
- Type
- EkoSDKInvalidParameterError
Returns:
Returns a promise.
- Type
- Promise.<undefined, EkoSDKError>
unflag(messageId) → {Promise.<undefined, EkoSDKError>}
Unflag a flagged message
Parameters:
Name | Type | Description |
---|---|---|
messageId |
String | The message ID of the flagged message. |
Throws:
-
Will throw an error if parameters are wrong.
- Type
- EkoSDKInvalidParameterError
Returns:
Returns a promise.
- Type
- Promise.<undefined, EkoSDKError>