Messages
- Source:
Methods
(inner) channelMessages(channelId, paramsopt) → {Promise}
- Source:
Retrieve paginated messages from a channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channelId |
string | Number | Id of a channel | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) createMessage(channelId, message) → {Promise}
- Source:
Create a message in a channel.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | A channel id |
message |
string | A message |
Returns:
- Type
- Promise
(inner) deleteMessage(channelId, messageId) → {Promise}
- Source:
Delete a message in a channel.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
messageId |
* | Id of the message to delete |
Returns:
- Type
- Promise
(inner) message(channelId, messageId, paramsopt) → {Promise}
- Source:
Retrieve a message from a channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channelId |
string | Number | Id of a channel | |
messageId |
string | Number | Id of a message | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) messages(messageIds) → {Promise}
- Source:
Retrieve a list of specified messages.
Parameters:
Name | Type | Description |
---|---|---|
messageIds |
string | Number | Message ids, max 200 |
Returns:
- Type
- Promise
(inner) messageThread(channelId, messageId, paramsopt) → {Promise}
- Source:
Retrieve messages in the same thread of a channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channelId |
string | Number | Id of a channel | |
messageId |
string | Number | Id of a message | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) personalMessages(paramsopt) → {Promise}
- Source:
Retrieve a paginated list of messages created by the authenticated user.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) searchMessages(params) → {Promise}
- Source:
Retrieve a list of messages filtered by the given criteria.
Example
pnut.searchMessages({
channelIds: [600, 18]
});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object |
Returns:
- Type
- Promise
(inner) sendMessage(destination, text) → {Promise}
- Source:
Send a private message.
"destination" can be either a single user id or an array of multiple users
Parameters:
Name | Type | Description |
---|---|---|
destination |
string | Number | Array | Destination of the PM |
text |
string | Text of the PM |
Returns:
- Type
- Promise
(inner) stickies(channelId, paramsopt) → {Promise}
- Source:
Retrieve sticky messsages in a channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channelId |
string | Number | Id of a channel | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) sticky(channelId, messageId) → {Promise}
- Source:
Sticky a message.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
messageId |
string | Number | Id of the message to sticky |
Returns:
- Type
- Promise
(inner) unsticky(channelId, messageId) → {Promise}
- Source:
Unsticky a message.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
messageId |
string | Number | Id of the message to unsticky |
Returns:
- Type
- Promise