5

I am retrieving all channels on a javascript client, but I got an issue because I need to order the channels throught the "channel updated" attribute and that's a problem because I am using this code to retreive the channels:

var messagingClient = new Twilio.Chat.Client(twilioToken);
messagingClient.initialize()
.then(() => messagingClient.getUserChannels())
.then((paginator) => {
    const channels = paginator.items;
    //This channels is not sorted by updated attribute
});

Now, that's not working for me because I have a support channel for each user and when the users amount increase in the future, then I will need to retrieve all channels to know event's channels like onMessageAdded. Also, I need to show only active channels on the visible channel list in frontend, and for that I need to know which channels have at least two messages. If the channel list were sorted by the "updated" attribute, then I could show the channels paginated and I would be sure that the first channels are the active ones.

1 Answers1

0

Twilio developer evangelist here.

I'm afraid that isn't currently supported in the API. However we understand that it does need to be a part of it in the future.

philnash
  • 70,667
  • 10
  • 60
  • 88