Channels
- Source:
Methods
(inner) channel(channelId, paramsopt) → {Promise}
- Source:
Retrieve a channel object.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
channelId |
string | number | A channel id | |
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) channels(channelIds) → {Promise}
- Source:
Retrieve a list of specified channel objects.
Parameters:
Name | Type | Description |
---|---|---|
channelIds |
string | number | channel ids, max 200 |
Returns:
- Type
- Promise
(inner) deactivateChannel(channelId) → {Promise}
- Source:
Deactivate a channel.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
Returns:
- Type
- Promise
(inner) markAllAsRead() → {Promise}
- Source:
Mark all unread private messages as read for the authenticated user.
Returns:
- Type
- Promise
(inner) muteChannel(channelId) → {Promise}
- Source:
Mute subscriptions for a channel. Muting unsubscribes, if you were subscribed.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
Returns:
- Type
- Promise
(inner) mutedChannels(paramsopt) → {Promise}
- Source:
Retrieve a list of channels the authenticated user has muted.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) pmChannelFor(userIds) → {Promise}
- Source:
Retrieve a Private Message channel for a set of users, if one exists.
Parameters:
Name | Type | Description |
---|---|---|
userIds |
string | number | user ids |
Returns:
- Type
- Promise
(inner) searchChannels(params) → {Promise}
- Source:
Retrieve a list of channels filtered by the given criteria.
Example
pnut.searchChannels({
isPublic: 1,
channelTypes: "io.pnut.core.chat",
categories: "fun"
});
Parameters:
Name | Type | Description |
---|---|---|
params |
Object | Search parameters |
Returns:
- Type
- Promise
(inner) subscribe(channelId) → {Promise}
- Source:
Subscribe to updates from a channel.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
Returns:
- Type
- Promise
(inner) subscribed(paramsopt) → {Promise}
- Source:
Retrieve a list of channels the authenticated user is subscribed to.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) subscribers(paramsopt, channelId) → {Promise}
- Source:
Retrieve a list of users subscribed to a channel.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
channelId |
string | Number | Id of a channel |
Returns:
- Type
- Promise
(inner) unmuteChannel(channelId) → {Promise}
- Source:
Delete a subscription mute for a channel.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
Returns:
- Type
- Promise
(inner) unread(paramsopt) → {Promise}
- Source:
Retrieve the number of unread private messages for the authenticated user.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise
(inner) unsubscribe(channelId) → {Promise}
- Source:
Delete a subscription for a channel.
Parameters:
Name | Type | Description |
---|---|---|
channelId |
string | Number | Id of a channel |
Returns:
- Type
- Promise
(inner) usersChannels(paramsopt) → {Promise}
- Source:
Retrieve a list of channels created by the authenticated user.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
params |
Object |
<optional> |
Additional URI parameters |
Returns:
- Type
- Promise