Share via


MessageExtensions<TState>.OnQuery Method

Definition

Overloads

OnQuery(MultipleRouteSelector, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

OnQuery(RouteSelectorAsync, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

OnQuery(String, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

OnQuery(Regex, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

OnQuery(MultipleRouteSelector, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

public Microsoft.Teams.AI.Application<TState> OnQuery(Microsoft.Teams.AI.MultipleRouteSelector routeSelectors, Microsoft.Teams.AI.QueryHandlerAsync<TState> handler);
member this.OnQuery : Microsoft.Teams.AI.MultipleRouteSelector * Microsoft.Teams.AI.QueryHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnQuery (routeSelectors As MultipleRouteSelector, handler As QueryHandlerAsync(Of TState)) As Application(Of TState)

Parameters

routeSelectors
MultipleRouteSelector

Combination of String, Regex, and RouteSelectorAsync selectors.

handler
QueryHandlerAsync<TState>

Function to call when the route is triggered.

Returns

The application instance for chaining purposes.

Applies to

OnQuery(RouteSelectorAsync, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

public Microsoft.Teams.AI.Application<TState> OnQuery(Microsoft.Teams.AI.RouteSelectorAsync routeSelector, Microsoft.Teams.AI.QueryHandlerAsync<TState> handler);
member this.OnQuery : Microsoft.Teams.AI.RouteSelectorAsync * Microsoft.Teams.AI.QueryHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnQuery (routeSelector As RouteSelectorAsync, handler As QueryHandlerAsync(Of TState)) As Application(Of TState)

Parameters

routeSelector
RouteSelectorAsync

Function that's used to select a route. The function returning true triggers the route.

handler
QueryHandlerAsync<TState>

Function to call when the route is triggered.

Returns

The application instance for chaining purposes.

Applies to

OnQuery(String, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

public Microsoft.Teams.AI.Application<TState> OnQuery(string commandId, Microsoft.Teams.AI.QueryHandlerAsync<TState> handler);
member this.OnQuery : string * Microsoft.Teams.AI.QueryHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnQuery (commandId As String, handler As QueryHandlerAsync(Of TState)) As Application(Of TState)

Parameters

commandId
String

ID of the command to register the handler for.

handler
QueryHandlerAsync<TState>

Function to call when the command is received.

Returns

The application instance for chaining purposes.

Applies to

OnQuery(Regex, QueryHandlerAsync<TState>)

Registers a handler that implements a Search based Message Extension.

public Microsoft.Teams.AI.Application<TState> OnQuery(System.Text.RegularExpressions.Regex commandIdPattern, Microsoft.Teams.AI.QueryHandlerAsync<TState> handler);
member this.OnQuery : System.Text.RegularExpressions.Regex * Microsoft.Teams.AI.QueryHandlerAsync<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))> -> Microsoft.Teams.AI.Application<'State (requires 'State :> Microsoft.Teams.AI.State.TurnState and 'State : (new : unit -> 'State))>
Public Function OnQuery (commandIdPattern As Regex, handler As QueryHandlerAsync(Of TState)) As Application(Of TState)

Parameters

commandIdPattern
Regex

Regular expression to match against the ID of the command to register the handler for.

handler
QueryHandlerAsync<TState>

Function to call when the command is received.

Returns

The application instance for chaining purposes.

Applies to