Open Channel: Advanced

This section explains the premium features of Open Channel. Some are available only to a paying user.


Admin messages

You can send an admin message to users in a channel using the SendBird Dashboard or the Platform API. To send the admin message via the Dashboard, in the Open Channels panel, select an open channel, find a message box below, click the Admin Message tab, and write a message in the box. The admin message is limited to 1000 characters.

Note: If you are currently developing under the Free Plan and therefore cannot use the Moderation Tools from the Dashboard, you must send the admin messages through the Platform API.


Channel cover images

When creating a channel, you can add a cover image by specifying an image URL or file.

OpenChannel.CreateChannel(NAME, COVER_IMAGE_OR_URL, DATA, (OpenChannel openChannel, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

You can fetch the cover image URL using the CoverUrl property. You can also update a channel's cover image by calling UpdateChannel().


Custom channel types

When creating a channel, you can additionally specify a custom type to further subclassify your channels. This custom type takes on the form of a String, and can be handy in searching or filtering channels.

Note: DATA and CUSTOM_TYPE are both String fields that allow you to append information to your channels. The intended use case is for CUSTOM_TYPE to contain information that can subclassify the channel (for example, distinguishing "School" and "Work" channels). However, both these fields can be flexibly utilized.

OpenChannel.CreateChannel(NAME, COVER_IMAGE_OR_URL, DATA, CUSTOM_TYPE, (OpenChannel openChannel, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

The CustomType property contains the channel's custom type.


Custom message types

Likewise, you can specify a custom type for messages to categorize them into more specific groups. This custom type takes on the form of a String, and can be useful in searching or filtering messages.

Note: DATA and CUSTOM_TYPE are both String fields that allow you to append information to your messages. The intended use case is for CUSTOM_TYPE to contain information that can subclassify the message (for example, distinguishing "FILE_IMAGE" and "FILE_AUDIO" type messages). However, both these fields can be flexibly utilized.

To embed a custom type into a message, simply pass a String parameter to channel.SendUserMessage() or channel.SendFileMessage().

openChannel.SendUserMessage(MESSAGE, DATA, CUSTOM_TYPE, (UserMessage userMessage, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

The CustomType property contains the message's custom type.


Message auto-translation

This feature is not available under the Free plan. Contact our sales team if you want to implement this functionality.

SendBird makes it possible for messages to be sent in different languages through its auto-translation feature. Pass in a List of language codes to SendUserMessage() to request translated messages in the corresponding languages.

List<string> targetLangs = new List<string>();
targetLangs.Add("es");
targetLangs.Add("ko");

openChannel.SendUserMessage(MESSAGE, DATA, CUSTOM_TYPE, targetLangs, (UserMessage userMessage, SendBirdException e) => {
    if (e != null) {
        // Error.
        return;
    }
});

You can obtain translations of a message through the Translations property. This contains a Dictionary containing the language codes and translations.

SendBirdClient.ChannelHandler ch = new SendBirdClient.ChannelHandler();
ch.OnMessageReceived = (BaseChannel baseChannel, BaseMessage baseMessage) => {
    // Received a chat message.
    // ((UserMessage)baseMessage).Translations["es"];
    // ((UserMessage)baseMessage).Translations["ko"];
};
SendBirdClient.AddChannelHandler(UNIQUE_HANDLER_ID, ch);

Note: The message auto-translation supports 53 languages. For the language code table, see the Miscellaneous > Supported Languages.


You search for specific channels by adding a keyword to your OpenChannelListQuery. There are two types of keywords: a Name Keyword and a URL Keyword.

A query containing a Name Keyword returns the list of open channels that have the keyword included in their names.

channelListQuery = OpenChannel.CreateOpenChannelListQuery();
channelListQuery.NameKeyword = "NameKeyword";

channelListQuery.Next((List<OpenChannel> channels, SendBirdException e) => {
    if (e != null) {
        // Error!
        return;
    }
    // Returns a List of channels that have "NameKeyword" in their names.
});

A query containing a URL Keyword to a query returns the open channel whose URL exactly matches the given keyword.

channelListQuery = OpenChannel.CreateOpenChannelListQuery();
channelListQuery.UrlKeyword = "UrlKeyword";

channelListQuery.Next((List<OpenChannel> channels, SendBirdException e) => {
    if (e != null) {
        // Error!
        return;
    }
    // Returns a List of channels that have "NameKeyword" in their names.
});