botframeworkv4 - List of available Channel IDs

2019-2020 Response:

The Channel list is available in Channels object in Microsoft.Bot.Connector namespace:

https://github.com/microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Connector/Channels.cs

2018 Response:

ChannelId is still an existing property in Activity object in v4, see sources:

https://github.com/Microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Schema/IActivity.cs

/// <summary>
/// Channel this activity is associated with
/// </summary>
string ChannelId { get; set; }

The list of channelId values is still available in v4 through Microsoft.Bot.Builder.Classic:

https://github.com/Microsoft/botbuilder-dotnet/blob/master/libraries/Microsoft.Bot.Builder.Classic/Microsoft.Bot.Builder.Classic/ConnectorEx/IChannelCapability.cs

public sealed class ChannelIds
{
    public const string Facebook = "facebook";
    public const string Skype = "skype";
    public const string Msteams = "msteams";
    public const string Telegram = "telegram";
    public const string Kik = "kik";
    public const string Email = "email";
    public const string Slack = "slack";
    public const string Groupme = "groupme";
    public const string Sms = "sms";
    public const string Emulator = "emulator";
    public const string Directline = "directline";
    public const string Webchat = "webchat";
    public const string Console = "console";
    public const string Cortana = "cortana";
}

Side note: you can simply add your own list:

public enum ChannelEnum
{
    emulator,
    facebook,
    skype,
    webchat,
    directline
    // ...
}

and use activity.ChannelId == ChannelEnum.webchat.ToString()


ChannelIds has been replaced with Channels in the C# V4 SDK and is available under Microsoft.Bot.Connector.

Checking for a specific channel can be done easily, for example:

var isEmail = turnContext.Activity.ChannelId == Channels.Email;

Use Nicholas R's answer if you need to add custom channels (or example Android, iOS) to the list.