On this page

Channel object

Channel is an object that refers to a single chat room.

Properties

The Channel object has the following properties:

1public class Channel : UniqueChatEntity {
2 public string Id { get; protected set; }
3 public string Name { get; }
4 public string Description { get; }
5 public Dictionary<string, object> CustomData { get; }
6 public string Updated { get; }
7 public string Status { get; }
8 public string Type { get; }
9}
ParameterDescription
Id
Type: string
Unique identifier for the channel. Verify the channel ID with our validator.
Name
Type: string
Display name or title of the channel.
Description
Type: string
Brief description or summary of the channel's purpose or content.
CustomData
Type: Dictionary<string, object>
Custom data associated with the channel in the form of a JSON. Values must be scalar only; arrays or objects are not supported. App Context filtering language doesn’t support filtering by custom properties.
Updated
Type: string
Timestamp indicating when the channel was last updated or modified.
Status
Type: string
Current status of the channel, such as online, offline, or archived.
Type
Type: string
One of the available channel types:
  • direct (1:1)
  • group (multiple people, restricted by invitation)
  • public (open chat for a large audience, anyone can join it)
API limits

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

Events

The Channel object has the following events:

1// Event triggered when a message is received on a channel
2public event Action<Message> OnMessageReceived;
3// Event triggered when a channel is updated
4public event Action<Channel> OnChannelUpdate;
5// Event triggered when a presence state changes on a channel
6public event Action<List<string>> OnPresenceUpdate;
7// Event triggered when typing is detected on a channel
8public event Action<List<string>> OnUsersTyping;
9// Event triggered when a read receipt is received on a channel
10public event Action<Dictionary<string, List<string>>> OnReadReceiptEvent;
11// Event triggered when a report is received on a channel
12public event Action<ChatEvent> OnReportEvent;
13// Event triggered when a custom event is received on a channel
14public event Action<ChatEvent> OnCustomEvent;

Example

An event that is triggered when a new message is received on a channel.

1

Methods

You can call the following methods on the Channel object.

Click on each method for more details.

Use case

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

Last updated on