Chat Channels

chat/channels@1.0.1
Supported by 2 providers
D
S

Get Channels

Retrieve paginated list of channels, e.g. text channels in slack or discord

Input
Workspace
Channel Visibility Filter
Limit
Page
Result
Channels
Next Page
Rate Limit

1.Choose a provider

2.Use GetChannels with mock in your code

npm i @superfaceai/one-sdk
const { SuperfaceClient } = require('@superfaceai/one-sdk');

const sdk = new SuperfaceClient();

async function run() {
  // Load the profile
  const profile = await sdk.getProfile('chat/channels@1.0.1');

  // Use the profile
  const result = await profile
    .getUseCase('GetChannels')
    .perform({
      visibility: 'public',
      limit: 2
    }, {
      provider: 'mock'
    });

  // Handle the result
  try {
    const data = result.unwrap();
    console.log(data);
  } catch (error) {
    console.error(error);
  }
}

run();

Structure details

Input (object)

workspace
Representation of a workspace. Can be guild or workspace, depending on the provider capability.
visibility
Limit the listing to either public or private channels; all channels are listed by default.
limit
Maximum number of channels to retrieve
page
Identification of page with paginated results (cursor)

Example

{
  "visibility": "public",
  "limit": 2
}

Result (object)

channels
List of retrieved channels
nextPage
Cursor to the next page of listing
rateLimit
Rate limit details

Example

{
  "channels": [
    {
      "id": "1",
      "createdAt": 1546167104000,
      "name": "random",
      "membersCount": 100
    }
  ]
}

Implementation details

Provider
mock
Use case
GetChannels
Author
@superface
Source
Verified