IConversations.SendToConversationAsync(IActivity, CancellationToken) 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.
SendToConversation.
public System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse> SendToConversationAsync(Microsoft.Agents.Core.Models.IActivity activity, System.Threading.CancellationToken cancellationToken = default);
abstract member SendToConversationAsync : Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function SendToConversationAsync (activity As IActivity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)
Parameters
- activity
- IActivity
Activity to send.
- cancellationToken
- CancellationToken
The cancellation token.
Returns
A task that represents the ResourceResponse.
Remarks
This method allows you to send an activity to the end of a conversation.
This is slightly different from ReplyToActivity(). * SendToConversation(conversationId) - will append the activity to the end of the conversation according to the timestamp or semantics of the channel. * ReplyToActivity(conversationId,ActivityId) - adds the activity as a reply to another activity, if the channel supports it. If the channel does not support nested replies, ReplyToActivity falls back to SendToConversation.
Use ReplyToActivity when replying to a specific activity in the conversation.
Use SendToConversation in all other cases.