Channel Participation

Members Query

Manage Members

TypeScript SDK provides methods to add and remove members in a channel.

Add channel members

Remove channel members

Note:

  1. The channel creator is automatically assigned as the channel moderator.

  2. The previous/last moderator is not allowed to leave a community and an error is displayed.

  3. The channel moderator can promote a user/member to moderator.

  4. The channel moderator can demote a moderator to a user/member.

This applies only to Live and Community channels’. This does not apply to Conversation Channel.

Channel Properties: hasMention and unreadCount

The Amity.Channel object exposes a unreadCount property that reflects the number of messages that the current user has yet to read. This count is the sum of all the unreadCount channels properties where the user is already a member. It also provides hasMention which is a boolean presenting having a mention for current user in channel.

Reading Status

The startReading() and stopReading() methods let the server know that the current user is reading a channel. After the startReading()and stopReading() methods are called, the unreadCount is reset to 0.

You can call both methods as many times as you require. The SDK takes care of multiple device management: thus, a user can read multiple channels from one or more devices simultaneously. In case of an abrupt disconnection (be it the app has been terminated or the Internet is down, etc.), the SDK backend automatically calls the stopReading command on behalf of the user.

Last updated