DelegatingTurnContext<T>.SendActivityAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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>
override this.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.
Implements
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
- UpdateActivityAsync(IActivity, CancellationToken)
- DeleteActivityAsync(ConversationReference, CancellationToken)
- OnSendActivities(SendActivitiesHandler)
- SendActivityAsync(String, String, String, CancellationToken)
- SendActivitiesAsync(IActivity[], CancellationToken)
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>
override this.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.
Implements
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
- UpdateActivityAsync(IActivity, CancellationToken)
- DeleteActivityAsync(ConversationReference, CancellationToken)
- OnSendActivities(SendActivitiesHandler)
- SendActivityAsync(IActivity, CancellationToken)
- SendActivitiesAsync(IActivity[], CancellationToken)