MessageExtension.OnQuery Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| OnQuery(MultipleRouteSelector, QueryHandlerAsync) |
Registers a handler that implements a Search based Message Extension. |
| OnQuery(RouteSelector, QueryHandlerAsync) |
Registers a handler that implements a Search based Message Extension. |
| OnQuery(String, QueryHandlerAsync) |
Registers a handler that implements a Search based Message Extension. |
| OnQuery(Regex, QueryHandlerAsync) |
Registers a handler that implements a Search based Message Extension. |
OnQuery(MultipleRouteSelector, QueryHandlerAsync)
Registers a handler that implements a Search based Message Extension.
public Microsoft.Agents.Builder.App.AgentApplication OnQuery(Microsoft.Agents.Builder.App.MultipleRouteSelector routeSelectors, Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync handler);
member this.OnQuery : Microsoft.Agents.Builder.App.MultipleRouteSelector * Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnQuery (routeSelectors As MultipleRouteSelector, handler As QueryHandlerAsync) As AgentApplication
Parameters
- routeSelectors
- MultipleRouteSelector
Combination of String, Regex, and RouteSelectorAsync selectors.
- handler
- QueryHandlerAsync
Function to call when the route is triggered.
Returns
The application instance for chaining purposes.
Applies to
OnQuery(RouteSelector, QueryHandlerAsync)
Registers a handler that implements a Search based Message Extension.
public Microsoft.Agents.Builder.App.AgentApplication OnQuery(Microsoft.Agents.Builder.App.RouteSelector routeSelector, Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync handler);
member this.OnQuery : Microsoft.Agents.Builder.App.RouteSelector * Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnQuery (routeSelector As RouteSelector, handler As QueryHandlerAsync) As AgentApplication
Parameters
- routeSelector
- RouteSelector
Function that's used to select a route. The function returning true triggers the route.
- handler
- QueryHandlerAsync
Function to call when the route is triggered.
Returns
The application instance for chaining purposes.
Applies to
OnQuery(String, QueryHandlerAsync)
Registers a handler that implements a Search based Message Extension.
public Microsoft.Agents.Builder.App.AgentApplication OnQuery(string commandId, Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync handler);
member this.OnQuery : string * Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnQuery (commandId As String, handler As QueryHandlerAsync) As AgentApplication
Parameters
- commandId
- String
ID of the command to register the handler for.
- handler
- QueryHandlerAsync
Function to call when the command is received.
Returns
The application instance for chaining purposes.
Applies to
OnQuery(Regex, QueryHandlerAsync)
Registers a handler that implements a Search based Message Extension.
public Microsoft.Agents.Builder.App.AgentApplication OnQuery(System.Text.RegularExpressions.Regex commandIdPattern, Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync handler);
member this.OnQuery : System.Text.RegularExpressions.Regex * Microsoft.Agents.Extensions.Teams.App.MessageExtensions.QueryHandlerAsync -> Microsoft.Agents.Builder.App.AgentApplication
Public Function OnQuery (commandIdPattern As Regex, handler As QueryHandlerAsync) As AgentApplication
Parameters
- commandIdPattern
- Regex
Regular expression to match against the ID of the command to register the handler for.
- handler
- QueryHandlerAsync
Function to call when the command is received.
Returns
The application instance for chaining purposes.