ITurnContext.SendActivityAsync Method

Definition

Overloads

SendActivityAsync(IActivity, CancellationToken)

Sends an activity to the sender of the incoming activity.

SendActivityAsync(String, String, String, CancellationToken)

Sends a message activity to the sender of the incoming activity.

SendActivityAsync(IActivity, CancellationToken)

Sends an activity to the sender of the incoming activity.

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

Parameters

activity
IActivity

The activity to send.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

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.

See also

Applies to

SendActivityAsync(String, String, String, CancellationToken)

Sends a message activity to the sender of the incoming activity.

public System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse> SendActivityAsync (string textReplyToSend, string speak = default, string inputHint = "acceptingInput", System.Threading.CancellationToken cancellationToken = default);
abstract member SendActivityAsync : string * string * string * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Bot.Schema.ResourceResponse>
Public Function SendActivityAsync (textReplyToSend As String, Optional speak As String = Nothing, Optional inputHint As String = "acceptingInput", Optional cancellationToken As CancellationToken = Nothing) As Task(Of ResourceResponse)

Parameters

textReplyToSend
String

The text of the message to send.

speak
String

Optional, text to be spoken by your bot on a speech-enabled channel.

inputHint
String

Optional, indicates whether your bot is accepting, expecting, or ignoring user input after the message is delivered to the client. InputHints defines the possible values. Default is AcceptingInput.

cancellationToken
CancellationToken

A cancellation token that can be used by other objects or threads to receive notice of cancellation.

Returns

A task that represents the work queued to execute.

Remarks

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

See the channel's documentation for limits imposed upon the contents of textReplyToSend.

To control various characteristics of your bot's speech such as voice, rate, volume, pronunciation, and pitch, specify speak in Speech Synthesis Markup Language (SSML) format.

See also

Applies to