如何获取频道中成员的未读邮件数?

时间:2019-02-18 13:36:38

标签: node.js twilio twilio-programmable-chat

我正在使用Twilio可编程聊天将聊天集成到Web应用程序中,我想获取某个频道中member的未读消息总数。

从这里开始-https://www.twilio.com/docs/chat/rest/members#retrieve-a-member-of-a-channel 我可以为特定频道中的每个成员获取“ last_consumed_message_index”。

我发现未读邮件数的方法是:

  memberUnReadMessageCount = channel.messagesCount - channelMember.lastConsumedMessageIndex;

但这不能正常工作。

此外,我还可以使用“用户频道资源”来获取频道中特定用户的unReadMessage计数。 https://www.twilio.com/docs/chat/rest/user-channels?code-sample=code-list-all-user-channels-code-sample&code-language=Node.js&code-sdk-version=3.x

但是我不能使用它,因为我不知道用户身份或用户sid。

没有用户通道资源API,我想查找通道中成员的未读消息计数。

0 个答案:

没有答案
相关问题