Sprog

ITeamsTurnContext.SendTargetedActivityAsync Method

Definition

Overloads

Name Description
SendTargetedActivityAsync(IActivity, ChannelAccount, CancellationToken)

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.

SendTargetedActivityAsync(IActivity, String, CancellationToken)

Sends an activity to a targeted user within the current conversation.

SendTargetedActivityAsync(String, ChannelAccount, CancellationToken)

Sends text as a targeted message to a user within the current conversation.

SendTargetedActivityAsync(String, String, CancellationToken)

Sends text as a targeted message to a user within the current conversation.

SendTargetedActivityAsync(IActivity, ChannelAccount, CancellationToken)

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, Microsoft.Agents.Core.Models.ChannelAccount recipient, System.Threading.CancellationToken cancellationToken = default);
abstract member SendTargetedActivityAsync : Microsoft.Agents.Core.Models.IActivity * Microsoft.Agents.Core.Models.ChannelAccount * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Agents.Core.Models.ResourceResponse>
Public Function SendTargetedActivityAsync (activity As IActivity, recipient As ChannelAccount, 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.

recipient
ChannelAccount

The account that should receive the targeted activity.

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

SendTargetedActivityAsync(IActivity, String, CancellationToken)

Sends an activity to a targeted user within the current conversation.

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

Parameters

activity
IActivity

The activity to send.

recipientId
String

The ID of the user account that should receive the targeted activity.

cancellationToken
CancellationToken

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

Returns

A task whose result contains information about the sent activity.

Applies to

SendTargetedActivityAsync(String, ChannelAccount, CancellationToken)

Sends text as a targeted message to a user within the current conversation.

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

Parameters

text
String

The text of the message to send.

recipient
ChannelAccount

The account that should receive the targeted message.

cancellationToken
CancellationToken

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

Returns

A task whose result contains information about the sent activity.

Applies to

SendTargetedActivityAsync(String, String, CancellationToken)

Sends text as a targeted message to a user within the current conversation.

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

Parameters

text
String

The text of the message to send.

recipientId
String

The ID of the user account that should receive the targeted message.

cancellationToken
CancellationToken

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

Returns

A task whose result contains information about the sent activity.

Applies to