Conversation.SendAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Process an incoming message within the conversation.
public static System.Threading.Tasks.Task SendAsync (Microsoft.Bot.Connector.IMessageActivity toBot, Func<Microsoft.Bot.Builder.Dialogs.IDialog<object>> MakeRoot, System.Threading.CancellationToken token = default);
static member SendAsync : Microsoft.Bot.Connector.IMessageActivity * Func<Microsoft.Bot.Builder.Dialogs.IDialog<obj>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Shared Function SendAsync (toBot As IMessageActivity, MakeRoot As Func(Of IDialog(Of Object)), Optional token As CancellationToken = Nothing) As Task
Parameters
- toBot
- IMessageActivity
The message sent to the bot.
- token
- CancellationToken
The cancellation token.
Returns
A task that represents the message to send inline back to the user.
Remarks
This method: 1. Instantiates and composes the required components. 2. Deserializes the dialog state (the dialog stack and each dialog's state) from the toBot
IMessageActivity. 3. Resumes the conversation processes where the dialog suspended to wait for a IMessageActivity. 4. Queues IMessageActivitys to be sent to the user. 5. Serializes the updated dialog state in the messages to be sent to the user.
The MakeRoot
factory method is invoked for new conversations only, because existing conversations have the dialog stack and state serialized in the IMessageActivity data.