Chat / JavaScript
Chat JavaScript v4
Chat JavaScript
Chat
JavaScript
Home
/
Chat
/
JavaScript
/
Message
This is the new Docs for Chat SDK v4 for JavaScript. To see the previous Docs, click here.

Retrieve number of members who haven't received a message

You can retrieve the number of members who haven’t received a specific message in a group channel. When the value of zero is returned, it means that the message has been successfully delivered to all members in the channel.

const channelCreateParams: GroupChannelCreateParams = {
    invitedUserIds = [USER_2, USER_3];
};
const channel = await sb.groupChannel.createChannel(channelCreateParams);

// ...

const messageCreateParams: UserMessageCreateParams = {
    message: 'Hi Sendbirdians!',
};
channel.sendUserMessage(messagCreateParams)
    .onSucceeded((message: UserMessage) => {
        const numberOfUndeliveredMembers = channel.getUndeliveredMemberCount(message);
        // ...
    });