Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Version 4
Home
/
Chat
/
JavaScript
/
Message

Retrieve number of unread messages in all channels

Copy link

By using the getTotalUnreadMessageCount() method, you can retrieve the total number of unread messages of a user in all group channels the user joined.

const count = await sb.groupChannel.getTotalUnreadMessageCount(
    {
        channelCustomTypesFilter?: string[];
        superChannelFilter?: SuperChannelFilter;
    }
);

TotalUnreadMessageCountParams

Copy link
Property nameTypeDescription

channelCustomTypesFilter

string[]

Channels with the specified custom channel types are returned.

superChannelFilter

SuperChannelFilter

Channels matching the specified group channel types are returned. Acceptable values are ALL, EXCLUSIVE_ONLY, SUPER, and NON_SUPER.