TurnContext.UpdateActivityAsync(IActivity, CancellationToken) Method

Definition

Replaces an existing activity.

public System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse> UpdateActivityAsync (Microsoft.Bot.Schema.IActivity activity, System.Threading.CancellationToken cancellationToken = default);
abstract member UpdateActivityAsync : Microsoft.Bot.Schema.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse>
override this.UpdateActivityAsync : Microsoft.Bot.Schema.IActivity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse>
Public Function UpdateActivityAsync (activity As IActivity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

activity
IActivity

New replacement activity.

cancellationToken
CancellationToken

Cancellation token.

Returns

A task that represents the work queued to execute.

Implements

Exceptions

The HTTP operation failed and the response contained additional information.

One or more exceptions occurred during the operation.

Remarks

If the activity is successfully sent, the task result contains a ResourceResponse object containing the ID that the receiving channel assigned to the activity.

Before calling this, set the ID of the replacement activity to the ID of the activity to replace.

Applies to