Language

ITeamsTurnContext.SendTargetedActivityAsync Method

Definition

Sends an activity to the conversation with a targeted treatment, allowing the activity to be directed to a specific recipient or group within the conversation.

public System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse> SendTargetedActivityAsync(Microsoft.Agents.Core.Models.IActivity activity, System.Threading.CancellationToken cancellationToken = default);
abstract member SendTargetedActivityAsync : Microsoft.Agents.Core.Models.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function SendTargetedActivityAsync (activity As IActivity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

activity
IActivity

The activity to send. Must represent the message or event to be delivered and cannot be null.

cancellationToken
CancellationToken

A cancellation token that can be used to cancel the send operation.

Returns

A task that represents the asynchronous send operation. The task result contains a ResourceResponse with information about the sent activity.

Applies to