CloudAdapterBase class

An adapter that implements the Bot Framework Protocol and can be hosted in different cloud environments both public and private.

Extends

Constructors

CloudAdapterBase(BotFrameworkAuthentication)

Create a new CloudAdapterBase instance.

Properties

ConnectorFactoryKey
onTurnError

Gets or sets an error handler that can catch exceptions in the middleware or application. Sets an error handler that can catch exceptions in the middleware or application.

UserTokenClientKey

Inherited Properties

BotIdentityKey
ConnectorClientKey
OAuthScopeKey

Methods

continueConversation(Partial<ConversationReference>, (context: TurnContext) => Promise<void>)
continueConversationAsync(string | ClaimsIdentity, Partial<ConversationReference>, (context: TurnContext) => Promise<void> | string, (context: TurnContext) => Promise<void>)
createConversationAsync(string, string, string, string, ConversationParameters, (context: TurnContext) => Promise<void>)
deleteActivity(TurnContext, Partial<ConversationReference>)
sendActivities(TurnContext, Partial<Activity>[])
updateActivity(TurnContext, Partial<Activity>)

Inherited Methods

use((context: TurnContext, next: () => Promise<void>) => Promise<void> | Middleware[])

Adds middleware to the adapter's pipeline.

Constructor Details

CloudAdapterBase(BotFrameworkAuthentication)

Create a new CloudAdapterBase instance.

new CloudAdapterBase(botFrameworkAuthentication: BotFrameworkAuthentication)

Parameters

botFrameworkAuthentication

BotFrameworkAuthentication

A BotFrameworkAuthentication used for validating and creating tokens.

Property Details

ConnectorFactoryKey

ConnectorFactoryKey: symbol

Property Value

symbol

onTurnError

Gets or sets an error handler that can catch exceptions in the middleware or application. Sets an error handler that can catch exceptions in the middleware or application.

(context: TurnContext, error: Error) => Promise<void> onTurnError

Property Value

(context: TurnContext, error: Error) => Promise<void>

A promise representing the async operation.

Remarks

The error handler is called with these parameters:

Name Type Description
context TurnContext The context object for the turn.
error Error The Node.js error thrown.

UserTokenClientKey

UserTokenClientKey: symbol

Property Value

symbol

Inherited Property Details

BotIdentityKey

BotIdentityKey: symbol

Property Value

symbol

Inherited From BotAdapter.BotIdentityKey

ConnectorClientKey

ConnectorClientKey: symbol

Property Value

symbol

Inherited From BotAdapter.ConnectorClientKey

OAuthScopeKey

OAuthScopeKey: symbol

Property Value

symbol

Inherited From BotAdapter.OAuthScopeKey

Method Details

continueConversation(Partial<ConversationReference>, (context: TurnContext) => Promise<void>)

Warning

This API is now deprecated.

function continueConversation(_reference: Partial<ConversationReference>, _logic: (context: TurnContext) => Promise<void>): Promise<void>

Parameters

_reference

Partial<ConversationReference>

_logic

(context: TurnContext) => Promise<void>

Returns

Promise<void>

continueConversationAsync(string | ClaimsIdentity, Partial<ConversationReference>, (context: TurnContext) => Promise<void> | string, (context: TurnContext) => Promise<void>)

function continueConversationAsync(botAppIdOrClaimsIdentity: string | ClaimsIdentity, reference: Partial<ConversationReference>, logicOrAudience: (context: TurnContext) => Promise<void> | string, maybeLogic?: (context: TurnContext) => Promise<void>): Promise<void>

Parameters

botAppIdOrClaimsIdentity

string | ClaimsIdentity

reference

Partial<ConversationReference>

logicOrAudience

(context: TurnContext) => Promise<void> | string

maybeLogic

(context: TurnContext) => Promise<void>

Returns

Promise<void>

createConversationAsync(string, string, string, string, ConversationParameters, (context: TurnContext) => Promise<void>)

function createConversationAsync(botAppId: string, channelId: string, serviceUrl: string, audience: string, conversationParameters: ConversationParameters, logic: (context: TurnContext) => Promise<void>): Promise<void>

Parameters

botAppId

string

channelId

string

serviceUrl

string

audience

string

conversationParameters

ConversationParameters

logic

(context: TurnContext) => Promise<void>

Returns

Promise<void>

deleteActivity(TurnContext, Partial<ConversationReference>)

function deleteActivity(context: TurnContext, reference: Partial<ConversationReference>): Promise<void>

Parameters

context
TurnContext
reference

Partial<ConversationReference>

Returns

Promise<void>

sendActivities(TurnContext, Partial<Activity>[])

function sendActivities(context: TurnContext, activities: Partial<Activity>[]): Promise<ResourceResponse[]>

Parameters

context
TurnContext
activities

Partial<Activity>[]

Returns

Promise<ResourceResponse[]>

updateActivity(TurnContext, Partial<Activity>)

function updateActivity(context: TurnContext, activity: Partial<Activity>): Promise<ResourceResponse | void>

Parameters

context
TurnContext
activity

Partial<Activity>

Returns

Promise<ResourceResponse | void>

Inherited Method Details

use((context: TurnContext, next: () => Promise<void>) => Promise<void> | Middleware[])

Adds middleware to the adapter's pipeline.

function use(middlewares: (context: TurnContext, next: () => Promise<void>) => Promise<void> | Middleware[]): this

Parameters

middlewares

(context: TurnContext, next: () => Promise<void>) => Promise<void> | Middleware[]

The middleware or middleware handlers to add.

Returns

this

The updated adapter object.

Remarks

Middleware is added to the adapter at initialization time. Each turn, the adapter calls its middleware in the order in which you added it.

Inherited From BotAdapter.use