ChannelServiceHandlerBase.OnReplyToActivityAsync Method

Definition

OnReplyToActivityAsync() API.

protected virtual System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse> OnReplyToActivityAsync (System.Security.Claims.ClaimsIdentity claimsIdentity, string conversationId, string activityId, Microsoft.Bot.Schema.Activity activity, System.Threading.CancellationToken cancellationToken = default);
abstract member OnReplyToActivityAsync : System.Security.Claims.ClaimsIdentity * string * string * Microsoft.Bot.Schema.Activity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse>
override this.OnReplyToActivityAsync : System.Security.Claims.ClaimsIdentity * string * string * Microsoft.Bot.Schema.Activity * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse>
Protected Overridable Function OnReplyToActivityAsync (claimsIdentity As ClaimsIdentity, conversationId As String, activityId As String, activity As Activity, Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

claimsIdentity
ClaimsIdentity

claimsIdentity for the bot, should have AudienceClaim, AppIdClaim and ServiceUrlClaim.

conversationId
String

Conversation ID.

activityId
String

activityId the reply is to (OPTIONAL).

activity
Activity

Activity to send.

cancellationToken
CancellationToken

The cancellation token.

Returns

task for a resource response.

Remarks

Override this method allows to reply to an Activity.

This is slightly different from SendToConversation(). * 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.

Applies to