title: How can I list all connected channels in Twilio?
body: <p>I'm trying to get a list of all connected channels in Twilio by using the following function:</p>
  
  <pre><code>chatClient.getUserChannelDescriptors().then(function(paginator) {
    for (i=0; i&lt;paginator.items.length; i++) {
      var channel = paginator.items[i];
      console.log('Channel: ' + channel.friendlyName);
    }
  });    
  </code></pre>
  
  <p>But this function always gives "chatClient is not a function" in the console. How can I fix this problem?</p>