ApplicationBuilder class
A builder class for simplifying the creation of an Application instance.
Methods
build() | Builds and returns a new Application instance. |
set |
Configures the removing of mentions of the bot's name from incoming messages. Default state for removeRecipientMention is true |
set |
Configures the typing timer when messages are received. Default state for startTypingTimer is true |
with |
Configures the processing of Adaptive Card requests. |
with |
Configures the AI system to use for processing incoming messages. |
with |
Configures user authentication settings. |
with |
Configures the application to use long running messages. Default state for longRunningMessages is false |
with |
Configures the storage system to use for storing the bot's state. |
with |
Configures the processing of Task Module requests. |
with |
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
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
ApplicationBuilder<TState>
The ApplicationBuilder instance.