BotAdapter.CreateConversationAsync Method

Definition

Creates a conversation on the specified channel.

public virtual System.Threading.Tasks.Task CreateConversationAsync (string botAppId, string channelId, string serviceUrl, string audience, Microsoft.Bot.Schema.ConversationParameters conversationParameters, Microsoft.Bot.Builder.BotCallbackHandler callback, System.Threading.CancellationToken cancellationToken);
abstract member CreateConversationAsync : string * string * string * string * Microsoft.Bot.Schema.ConversationParameters * Microsoft.Bot.Builder.BotCallbackHandler * System.Threading.CancellationToken -> System.Threading.Tasks.Task
override this.CreateConversationAsync : string * string * string * string * Microsoft.Bot.Schema.ConversationParameters * Microsoft.Bot.Builder.BotCallbackHandler * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Overridable Function CreateConversationAsync (botAppId As String, channelId As String, serviceUrl As String, audience As String, conversationParameters As ConversationParameters, callback As BotCallbackHandler, cancellationToken As CancellationToken) As Task

Parameters

botAppId
String

TThe application ID of the bot.

channelId
String

The ID for the channel.

serviceUrl
String

The channel's service URL endpoint.

audience
String

The audience for the connector.

conversationParameters
ConversationParameters

The conversation information to use to create the conversation.

callback
BotCallbackHandler

The method to call for the resulting bot turn.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

To start a conversation, your bot must know its account information and the user's account information on that channel. Most _channels only support initiating a direct message (non-group) conversation.

The adapter attempts to create a new conversation on the channel, and then sends a conversationUpdate activity through its middleware pipeline to the callback method.

If the conversation is established with the specified users, the ID of the activity's Conversation will contain the ID of the new conversation.

Applies to