Membership object

Membership is an object that refers to a single user-channel relationship in a chat.

Properties

The Membership object has the following properties:

public class Membership : UniqueChatEntity {
public string Id { get; protected set; }
public string UserId { get; }
public string ChannelId { get; }
}
ParameterTypeDescription
IdstringUnique identifier for the membership which is a combination of UserId and ChannelId.
UserIdstringThe user ID of the user that this membership belongs to.
ChannelIdstringThe channel ID of the channel that this membership belongs to.
API limits

To learn about the maximum length of parameters used to set channel membership metadata, refer to REST API docs.

Events

The Membership object has the following event:

// Event triggered when user-channel membership is updated
public event Action<Membership> OnMembershipUpdated;

Example

An event that is triggered when user-channel membership is updated by the server.

membership.OnMembershipUpdated += (membership) =>
{
Console.WriteLine("Membership metadata updated!");
};

Methods

You can call the following methods on the Membership object.

Click on each method for more details.

Use case

For example, you can use the Membership object methods to:

Last updated on