IConversations.SendToConversationWithHttpMessagesAsync 方法

定义

重载

SendToConversationWithHttpMessagesAsync(String, Activity, Dictionary<String,List<String>>, CancellationToken)
SendToConversationWithHttpMessagesAsync(String, Activity, Dictionary<String,List<String>>, CancellationToken)

SendToConversation。

SendToConversationWithHttpMessagesAsync(String, Activity, Dictionary<String,List<String>>, CancellationToken)

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ResourceResponse>> SendToConversationWithHttpMessagesAsync (string conversationId, Microsoft.Bot.Connector.Activity activity, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SendToConversationWithHttpMessagesAsync : string * Microsoft.Bot.Connector.Activity * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Connector.ResourceResponse>>
Public Function SendToConversationWithHttpMessagesAsync (conversationId As String, activity As Activity, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ResourceResponse))

参数

conversationId
String
activity
Activity
customHeaders
Dictionary<String,List<String>>
cancellationToken
CancellationToken

返回

Task<Microsoft.Rest.HttpOperationResponse<ResourceResponse>>

适用于

SendToConversationWithHttpMessagesAsync(String, Activity, Dictionary<String,List<String>>, CancellationToken)

SendToConversation。

public System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ResourceResponse>> SendToConversationWithHttpMessagesAsync (string conversationId, Microsoft.Bot.Schema.Activity activity, System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>> customHeaders = default, System.Threading.CancellationToken cancellationToken = default);
abstract member SendToConversationWithHttpMessagesAsync : string * Microsoft.Bot.Schema.Activity * System.Collections.Generic.Dictionary<string, System.Collections.Generic.List<string>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Rest.HttpOperationResponse<Microsoft.Bot.Schema.ResourceResponse>>
Public Function SendToConversationWithHttpMessagesAsync (conversationId As String, activity As Activity, Optional customHeaders As Dictionary(Of String, List(Of String)) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of HttpOperationResponse(Of ResourceResponse))

参数

conversationId
String

对话 ID。

activity
Activity

要发送的活动。

customHeaders
Dictionary<String,List<String>>

将添加到请求的标头。

cancellationToken
CancellationToken

取消标记。

返回

Task<Microsoft.Rest.HttpOperationResponse<ResourceResponse>>

表示 Microsoft.Rest.HttpOperationResponse的任务。

例外

当操作返回无效状态代码时引发。

Microsoft.Rest.SerializationException

当无法反序列化响应时引发。

Microsoft.Rest.ValidationException

当所需参数为 null 时引发。

注解

此方法允许将活动发送到会话的末尾。

这与 ReplyToActivity () 略有不同。 * SendToConversation (conversationId) - 将根据通道的时间戳或语义将活动追加到会话的末尾。 * ReplyToActivity (conversationId,ActivityId) - 将活动作为回复添加到另一个活动(如果通道支持)。 如果通道不支持嵌套答复,则 ReplyToActivity 将回退到 SendToConversation。

回复聊天中的特定活动时,请使用 ReplyToActivity。

在所有其他情况下使用 SendToConversation。

适用于