BotFrameworkAdapter 类

定义

注意

Use CloudAdapter instead.

可将机器人连接到服务终结点的机器人适配器。

[System.Obsolete("Use `CloudAdapter` instead.", false)]
public class BotFrameworkAdapter : Microsoft.Bot.Builder.BotAdapter, Microsoft.Bot.Builder.IExtendedUserTokenProvider, Microsoft.Bot.Builder.Integration.IAdapterIntegration, Microsoft.Bot.Builder.OAuth.IConnectorClientBuilder
[<System.Obsolete("Use `CloudAdapter` instead.", false)>]
type BotFrameworkAdapter = class
    inherit BotAdapter
    interface IAdapterIntegration
    interface IExtendedUserTokenProvider
    interface IUserTokenProvider
    interface IConnectorClientBuilder
Public Class BotFrameworkAdapter
Inherits BotAdapter
Implements IAdapterIntegration, IConnectorClientBuilder, IExtendedUserTokenProvider
继承
BotFrameworkAdapter
派生
属性
实现

注解

机器人适配器封装了身份验证过程,并将活动发送到机器人连接器服务并从机器人连接器服务接收活动。 当机器人收到活动时,适配器会创建上下文对象,将其传递给机器人的应用程序逻辑,并将响应发送回用户的通道。

使用 Use(IMiddleware) 将 对象添加到 IMiddleware 适配器的中间件集合。 适配器处理传入的活动并通过机器人中间件管道将其定向到机器人的逻辑,然后再返回。 当每个活动流入和流出机器人时,每个中间件都可以在机器人逻辑运行前后对其进行检查或执行操作。

构造函数

BotFrameworkAdapter(AppCredentials, AuthenticationConfiguration, IChannelProvider, RetryPolicy, HttpClient, IMiddleware, ILogger)
已过时.

使用凭据提供程序初始化 类的新实例 BotFrameworkAdapter

BotFrameworkAdapter(ICredentialProvider, AuthenticationConfiguration, IChannelProvider, RetryPolicy, HttpClient, IMiddleware, ILogger)
已过时.

使用凭据提供程序初始化 类的新实例 BotFrameworkAdapter

BotFrameworkAdapter(ICredentialProvider, IChannelProvider, RetryPolicy, HttpClient, IMiddleware, ILogger)
已过时.

使用凭据提供程序初始化 类的新实例 BotFrameworkAdapter

字段

BotIdentityKey
已过时.

机器人标识密钥的字符串值。

(继承自 BotAdapter)
InvokeResponseKey
已过时.

将位于 TurnState 上的任何 InvokeResponseActivity 的键值。

(继承自 BotAdapter)
OAuthScopeKey
已过时.

OAuth 范围密钥的字符串值。

(继承自 BotAdapter)

属性

AppCredentialMap
已过时.

获取此适配器到的应用程序 AppCredentials 的映射。

ChannelProvider
已过时.

获取此适配器的通道提供程序。

CredentialProvider
已过时.

获取此适配器的凭据提供程序。

HttpClient
已过时.

获取此适配器的自定义 HttpClient (如果已指定)。

Logger
已过时.

获取此适配器的记录器。

MiddlewareSet
已过时.

获取适配器管道中的中间件集合。

(继承自 BotAdapter)
OnTurnError
已过时.

获取或设置一个错误处理程序,该处理程序可以捕获中间件或应用程序中的异常。

(继承自 BotAdapter)

方法

BuildCredentialsAsync(String, String)
已过时.

用于生成 AppCredentials 要用于获取此 HttpClient 令牌的对象的逻辑。

CanProcessOutgoingActivity(Activity)
已过时.

子类选择加入处理传出活动的机会。

ContinueConversationAsync(ClaimsIdentity, Activity, BotCallbackHandler, CancellationToken)
已过时.

向对话发送主动消息。

(继承自 BotAdapter)
ContinueConversationAsync(ClaimsIdentity, Activity, String, BotCallbackHandler, CancellationToken)
已过时.

向对话发送主动消息。

(继承自 BotAdapter)
ContinueConversationAsync(ClaimsIdentity, ConversationReference, BotCallbackHandler, CancellationToken)
已过时.

将主动消息从机器人发送到对话。

ContinueConversationAsync(ClaimsIdentity, ConversationReference, String, BotCallbackHandler, CancellationToken)
已过时.

将主动消息从机器人发送到对话。

ContinueConversationAsync(String, Activity, BotCallbackHandler, CancellationToken)
已过时.

向对话发送主动消息。

(继承自 BotAdapter)
ContinueConversationAsync(String, ConversationReference, BotCallbackHandler, CancellationToken)
已过时.

将主动消息从机器人发送到对话。

CreateConversationAsync(String, String, AppCredentials, ConversationParameters, BotCallbackHandler, CancellationToken)
已过时.

在指定通道上创建对话。

CreateConversationAsync(String, String, AppCredentials, ConversationParameters, BotCallbackHandler, ConversationReference, CancellationToken)
已过时.

在指定通道上创建对话。 重载接收 ConversationReference,包括租户。

CreateConversationAsync(String, String, MicrosoftAppCredentials, ConversationParameters, BotCallbackHandler, CancellationToken)
已过时.

在指定通道上创建对话。

CreateConversationAsync(String, String, MicrosoftAppCredentials, ConversationParameters, BotCallbackHandler, ConversationReference, CancellationToken)
已过时.

在指定通道上创建对话。 重载接收 ConversationReference,包括租户。

CreateConversationAsync(String, String, String, String, ConversationParameters, BotCallbackHandler, CancellationToken)
已过时.

在指定通道上创建对话。

(继承自 BotAdapter)
CreateOAuthApiClientAsync(ITurnContext)
已过时.

为机器人创建 OAuth 客户端。

CreateOAuthApiClientAsync(ITurnContext, AppCredentials)
已过时.

使用凭据为机器人创建 OAuth 客户端。

DeleteActivityAsync(ITurnContext, ConversationReference, CancellationToken)
已过时.

删除对话中的现有活动。

DeleteConversationMemberAsync(ITurnContext, String, CancellationToken)
已过时.

从当前对话中删除成员。

ExchangeTokenAsync(ITurnContext, AppCredentials, String, String, TokenExchangeRequest, CancellationToken)
已过时.

执行令牌交换操作,例如用于单一登录。

ExchangeTokenAsync(ITurnContext, String, String, TokenExchangeRequest, CancellationToken)
已过时.

执行令牌交换操作,例如用于单一登录。

GetAadTokensAsync(ITurnContext, AppCredentials, String, String[], String, CancellationToken)
已过时.

使用自定义的 AppCredentials 检索配置连接上特定资源的 Azure Active Directory 令牌。

GetAadTokensAsync(ITurnContext, String, String[], String, CancellationToken)
已过时.

使用机器人的 AppCredentials 检索已配置连接上特定资源的 Azure Active Directory 令牌。

GetActivityMembersAsync(ITurnContext, String, CancellationToken)
已过时.

列出给定活动的成员。

GetConversationMembersAsync(ITurnContext, CancellationToken)
已过时.

列出当前对话的成员。

GetConversationsAsync(ITurnContext, String, CancellationToken)
已过时.

列出此机器人为给定通道服务器参与的对话。 通道服务器以页形式返回结果,每个页面将包含 continuationToken 可用于从服务器提取下一页结果的 。

GetConversationsAsync(String, MicrosoftAppCredentials, String, CancellationToken)
已过时.

列出此机器人为给定通道服务器参与的对话。 通道服务器以页形式返回结果,每个页面将包含 continuationToken 可用于从服务器提取下一页结果的 。

GetOauthSignInLinkAsync(ITurnContext, AppCredentials, String, CancellationToken)
已过时.

使用自定义的 AppCredentials 获取要发送给用户以登录的连接名称的原始登录链接。

GetOauthSignInLinkAsync(ITurnContext, AppCredentials, String, String, String, CancellationToken)
已过时.

使用自定义的 AppCredentials 获取要发送给用户以登录的连接名称的原始登录链接。

GetOauthSignInLinkAsync(ITurnContext, String, CancellationToken)
已过时.

使用机器人的 AppCredentials 获取要发送给用户用于登录的连接名称的原始登录链接。

GetOauthSignInLinkAsync(ITurnContext, String, String, String, CancellationToken)
已过时.

使用机器人的 AppCredentials 获取要发送给用户用于登录的连接名称的原始登录链接。

GetSignInResourceAsync(ITurnContext, AppCredentials, String, String, String, CancellationToken)
已过时.

获取要发送给用户进行登录的原始登录链接,以获取连接名称。

GetSignInResourceAsync(ITurnContext, String, CancellationToken)
已过时.

获取要发送给用户进行登录的原始登录链接,以获取连接名称。

GetSignInResourceAsync(ITurnContext, String, String, String, CancellationToken)
已过时.

获取要发送给用户进行登录的原始登录链接,以获取连接名称。

GetTokenStatusAsync(ITurnContext, AppCredentials, String, String, CancellationToken)
已过时.

使用自定义的 AppCredentials 检索给定用户的每个已配置连接的令牌状态。

GetTokenStatusAsync(ITurnContext, String, String, CancellationToken)
已过时.

使用机器人的 AppCredentials 检索给定用户的每个已配置连接的令牌状态。

GetUserTokenAsync(ITurnContext, AppCredentials, String, String, CancellationToken)
已过时.

尝试使用自定义 AppCredentials 检索登录流中的用户的令牌。

GetUserTokenAsync(ITurnContext, String, String, CancellationToken)
已过时.

尝试使用机器人的 AppCredentials 检索登录流中的用户的令牌。

ProcessActivityAsync(ClaimsIdentity, Activity, BotCallbackHandler, CancellationToken)
已过时.

创建轮次上下文并运行传入活动的中间件管道。

ProcessActivityAsync(String, Activity, BotCallbackHandler, CancellationToken)
已过时.

创建轮次上下文并运行传入活动的中间件管道。

ProcessOutgoingActivityAsync(ITurnContext, Activity, CancellationToken)
已过时.

用于发送传出活动的自定义逻辑。 子类可以替代此方法以及 CanProcessOutgoingActivity,以便具有处理传出活动的自定义逻辑。

RunPipelineAsync(ITurnContext, BotCallbackHandler, CancellationToken)
已过时.

启动当前机器人轮次的活动处理。

(继承自 BotAdapter)
SendActivitiesAsync(ITurnContext, Activity[], CancellationToken)
已过时.

将活动发送到对话。

SignOutUserAsync(ITurnContext, AppCredentials, String, String, CancellationToken)
已过时.

使用自定义 AppCredentials 使用令牌服务器将用户注销。

SignOutUserAsync(ITurnContext, String, String, CancellationToken)
已过时.

使用机器人的 AppCredentials 通过令牌服务器将用户注销。

UpdateActivityAsync(ITurnContext, Activity, CancellationToken)
已过时.

替换对话中的现有活动。

Use(IMiddleware)
已过时.

将中间件添加到适配器的管道。

显式接口实现

IConnectorClientBuilder.CreateConnectorClientAsync(String, ClaimsIdentity, String, CancellationToken)
已过时.

可将机器人连接到服务终结点的机器人适配器。

扩展方法

UseBotState(BotAdapter, BotState[])
已过时.

将中间件添加到适配器,以在轮次上下文中注册一个或多个 BotState 对象。 中间件在每个轮次开始时在轮次上下文中注册状态对象。

UseState(BotAdapter, UserState, ConversationState, Boolean)
已过时.

向适配器注册用户和会话状态对象。 这些对象将通过轮次上下文的 TurnState.Get<T>() 方法提供。

UseStorage(BotAdapter, IStorage)
已过时.

将中间件添加到适配器,以在轮次上下文中注册对象 IStorage 。 中间件在每个轮次开始时在轮次上下文中注册状态对象。

适用于

另请参阅