Channel Class

  • java.lang.Object
    • com.microsoft.bot.dialogs.choices.Channel

public final class Channel

Methods for determining channel specific functionality.

Method Summary

Modifier and Type Method and Description
static java.lang.String getChannelId(TurnContext turnContext)

Get the Channel Id from the current Activity on the Turn Context.

static boolean hasMessageFeed(String channelId)

Determine if a Channel has a Message Feed.

static int maxActionTitleLength(String channelId)

Maximum length allowed for Action Titles.

static boolean supportsCardActions(String channelId)

Determine if a number of Card Actions are supported by a Channel.

static boolean supportsCardActions(String channelId, int buttonCnt)

Determine if a number of Card Actions are supported by a Channel.

static boolean supportsSuggestedActions(String channelId)

Determine if a number of Suggested Actions are supported by a Channel.

static boolean supportsSuggestedActions(String channelId, int buttonCnt)

Determine if a number of Suggested Actions are supported by a Channel.

Methods inherited from java.lang.Object

java.lang.Object.clone java.lang.Object.equals java.lang.Object.finalize java.lang.Object.getClass java.lang.Object.hashCode java.lang.Object.notify java.lang.Object.notifyAll java.lang.Object.toString java.lang.Object.wait java.lang.Object.wait java.lang.Object.wait

Method Details

getChannelId

public static String getChannelId(TurnContext turnContext)

Get the Channel Id from the current Activity on the Turn Context.

Parameters:

turnContext - The Turn Context to retrieve the Activity's Channel Id from.

Returns:

The Channel Id from the Turn Context's Activity.

hasMessageFeed

public static boolean hasMessageFeed(String channelId)

Determine if a Channel has a Message Feed.

Parameters:

channelId - The Channel to check for Message Feed.

Returns:

True if the Channel has a Message Feed, False if it does not.

maxActionTitleLength

public static int maxActionTitleLength(String channelId)

Maximum length allowed for Action Titles.

Parameters:

channelId - The Channel to determine Maximum Action Title Length.

Returns:

The total number of characters allowed for an Action Title on a specific Channel.

supportsCardActions

public static boolean supportsCardActions(String channelId)

Determine if a number of Card Actions are supported by a Channel.

Parameters:

channelId - The Channel to check if the Card Actions are supported in.

Returns:

True if the Channel supports the buttonCnt total Card Actions, False if the Channel does not support that number of Card Actions.

supportsCardActions

public static boolean supportsCardActions(String channelId, int buttonCnt)

Determine if a number of Card Actions are supported by a Channel.

Parameters:

channelId - The Channel to check if the Card Actions are supported in.
buttonCnt - The number of Card Actions to check for the Channel.

Returns:

True if the Channel supports the buttonCnt total Card Actions, False if the Channel does not support that number of Card Actions.

supportsSuggestedActions

public static boolean supportsSuggestedActions(String channelId)

Determine if a number of Suggested Actions are supported by a Channel.

Parameters:

channelId - The Channel to check the if Suggested Actions are supported in.

Returns:

True if the Channel supports the buttonCnt total Suggested Actions, False if the Channel does not support that number of Suggested Actions.

supportsSuggestedActions

public static boolean supportsSuggestedActions(String channelId, int buttonCnt)

Determine if a number of Suggested Actions are supported by a Channel.

Parameters:

channelId - The Channel to check the if Suggested Actions are supported in.
buttonCnt - The number of Suggested Actions to check for the Channel.

Returns:

True if the Channel supports the buttonCnt total Suggested Actions, False if the Channel does not support that number of Suggested Actions.

Applies to