You can retrieve the count of a user's unread messages, unread mentioned messages, or received invitations in group channels and Supergroup channels. You can use this action to display the count in the UI and prompt the user to check unread messages and invitations. This is only available for group channels and Supergroup channels.
To get the count, create a UnreadItemCountParams
instance by setting UnreadItemKey
in keys
. Then pass it to the getUnreadItemCount()
method.
The following table lists acceptable values for UnreadItemKey
.
Value | Description |
---|---|
GROUP_CHANNEL_INVITATION_COUNT | The number of invitations the user has received for all group channels and Supergroup channels. |
GROUP_CHANNEL_UNREAD_MENTION_COUNT | The number of messages the user was mentioned but hasn't read in all group channels and Supergroup channels. |
GROUP_CHANNEL_UNREAD_MESSAGE_COUNT | The number of messages the user hasn't read in all group channels and Supergroup channels. |
NONSUPER_INVITATION_COUNT | The number of invitations the user has received for all group channels channels. |
NONSUPER_UNREAD_MENTION_COUNT | The number of messages the user was mentioned but hasn't read in all group channels. |
NONSUPER_UNREAD_MESSAGE_COUNT | The number of messages the user hasn't read in all group channels channels. |
SUPER_INVITATION_COUNT | The number of invitations the user has received for all Supergroup channels. |
SUPER_UNREAD_MENTION_COUNT | The number of messages the user was mentioned but hasn't read in all Supergroup channels. |
SUPER_UNREAD_MESSAGE_COUNT | The number of messages the user hasn't read in all Supergroup channels. |