ApplicationBuilder class

A builder class for simplifying the creation of an Application instance.

Methods

build()

Builds and returns a new Application instance.

setRemoveRecipientMention(boolean)

Configures the removing of mentions of the bot's name from incoming messages. Default state for removeRecipientMention is true

setStartTypingTimer(boolean)

Configures the typing timer when messages are received. Default state for startTypingTimer is true

withAdaptiveCardOptions(AdaptiveCardsOptions)

Configures the processing of Adaptive Card requests.

withAIOptions(AIOptions<TState>)

Configures the AI system to use for processing incoming messages.

withAuthentication(TeamsAdapter, AuthenticationOptions)

Configures user authentication settings.

withLongRunningMessages(TeamsAdapter, string)

Configures the application to use long running messages. Default state for longRunningMessages is false

withStorage(Storage)

Configures the storage system to use for storing the bot's state.

withTaskModuleOptions(TaskModulesOptions)

Configures the processing of Task Module requests.

withTurnStateFactory(() => TState)

Configures the turn state factory for managing the bot's turn state.

Method Details

build()

Builds and returns a new Application instance.

function build(): Application<TState>

Returns

Application<TState>

The Application instance.

setRemoveRecipientMention(boolean)

Configures the removing of mentions of the bot's name from incoming messages. Default state for removeRecipientMention is true

function setRemoveRecipientMention(removeRecipientMention: boolean): ApplicationBuilder<TState>

Parameters

removeRecipientMention

boolean

The boolean for removing reciepient mentions.

Returns

The ApplicationBuilder instance.

setStartTypingTimer(boolean)

Configures the typing timer when messages are received. Default state for startTypingTimer is true

function setStartTypingTimer(startTypingTimer: boolean): ApplicationBuilder<TState>

Parameters

startTypingTimer

boolean

The boolean for starting the typing timer.

Returns

The ApplicationBuilder instance.

withAdaptiveCardOptions(AdaptiveCardsOptions)

Configures the processing of Adaptive Card requests.

function withAdaptiveCardOptions(adaptiveCardOptions: AdaptiveCardsOptions): ApplicationBuilder<TState>

Parameters

adaptiveCardOptions
AdaptiveCardsOptions

The options for the Adaptive Cards.

Returns

The ApplicationBuilder instance.

withAIOptions(AIOptions<TState>)

Configures the AI system to use for processing incoming messages.

function withAIOptions(aiOptions: AIOptions<TState>): ApplicationBuilder<TState>

Parameters

aiOptions

AIOptions<TState>

The options for the AI system.

Returns

The ApplicationBuilder instance.

withAuthentication(TeamsAdapter, AuthenticationOptions)

Configures user authentication settings.

function withAuthentication(adapter: TeamsAdapter, authenticationOptions: AuthenticationOptions): ApplicationBuilder<TState>

Parameters

adapter
TeamsAdapter

The adapter to use for user authentication.

authenticationOptions
AuthenticationOptions

The options to configure the authentication manager.

Returns

The ApplicationBuilder instance.

withLongRunningMessages(TeamsAdapter, string)

Configures the application to use long running messages. Default state for longRunningMessages is false

function withLongRunningMessages(adapter: TeamsAdapter, botAppId: string): ApplicationBuilder<TState>

Parameters

adapter
TeamsAdapter

The adapter to use for routing incoming requests.

botAppId

string

The Microsoft App ID for the bot.

Returns

The ApplicationBuilder instance.

withStorage(Storage)

Configures the storage system to use for storing the bot's state.

function withStorage(storage: Storage): ApplicationBuilder<TState>

Parameters

storage

Storage

The storage system to use.

Returns

The ApplicationBuilder instance.

withTaskModuleOptions(TaskModulesOptions)

Configures the processing of Task Module requests.

function withTaskModuleOptions(taskModuleOptions: TaskModulesOptions): ApplicationBuilder<TState>

Parameters

taskModuleOptions
TaskModulesOptions

The options for the Task Modules.

Returns

The ApplicationBuilder instance.

withTurnStateFactory(() => TState)

Configures the turn state factory for managing the bot's turn state.

function withTurnStateFactory(turnStateFactory: () => TState): ApplicationBuilder<TState>

Parameters

turnStateFactory

() => TState

Factory used to create a custom turn state instance.

Returns

The ApplicationBuilder instance.