TeamsAppExtensions.OnTeamsEvent 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
| Name | Description |
|---|---|
| OnTeamsEvent(AgentApplication, RouteSelector, TeamsRouteHandler, UInt16, String[], Boolean) |
Registers a Teams event handler using a custom route selector. |
| OnTeamsEvent(AgentApplication, String, TeamsRouteHandler, UInt16, String[], Boolean) |
Registers a Teams event handler for the specified event name. |
| OnTeamsEvent(AgentApplication, Regex, TeamsRouteHandler, UInt16, String[], Boolean) |
Registers a Teams event handler for event names that match the supplied pattern. |
OnTeamsEvent(AgentApplication, RouteSelector, TeamsRouteHandler, UInt16, String[], Boolean)
Registers a Teams event handler using a custom route selector.
public static Microsoft.Agents.Builder.App.AgentApplication OnTeamsEvent(this Microsoft.Agents.Builder.App.AgentApplication app, Microsoft.Agents.Builder.App.RouteSelector routeSelector, Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default, bool isAgenticOnly = false);
static member OnTeamsEvent : Microsoft.Agents.Builder.App.AgentApplication * Microsoft.Agents.Builder.App.RouteSelector * Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler * uint16 * string[] * bool -> Microsoft.Agents.Builder.App.AgentApplication
<Extension()>
Public Function OnTeamsEvent (app As AgentApplication, routeSelector As RouteSelector, handler As TeamsRouteHandler, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing, Optional isAgenticOnly As Boolean = false) As AgentApplication
Parameters
- app
- AgentApplication
The agent application to configure.
- routeSelector
- RouteSelector
The custom selector that determines whether the route matches.
- handler
- TeamsRouteHandler
The Teams-aware handler to invoke.
- rank
- UInt16
The route evaluation order. Lower values run first.
- autoSignInHandlers
- String[]
The OAuth sign-in handlers to associate with the route.
- isAgenticOnly
- Boolean
When true, the route only fires for agentic turns.
Returns
The configured agent application.
Applies to
OnTeamsEvent(AgentApplication, String, TeamsRouteHandler, UInt16, String[], Boolean)
Registers a Teams event handler for the specified event name.
public static Microsoft.Agents.Builder.App.AgentApplication OnTeamsEvent(this Microsoft.Agents.Builder.App.AgentApplication app, string eventName, Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default, bool isAgenticOnly = false);
static member OnTeamsEvent : Microsoft.Agents.Builder.App.AgentApplication * string * Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler * uint16 * string[] * bool -> Microsoft.Agents.Builder.App.AgentApplication
<Extension()>
Public Function OnTeamsEvent (app As AgentApplication, eventName As String, handler As TeamsRouteHandler, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing, Optional isAgenticOnly As Boolean = false) As AgentApplication
Parameters
- app
- AgentApplication
The agent application to configure.
- eventName
- String
The exact event name to match.
- handler
- TeamsRouteHandler
The Teams-aware handler to invoke.
- rank
- UInt16
The route evaluation order. Lower values run first.
- autoSignInHandlers
- String[]
The OAuth sign-in handlers to associate with the route.
- isAgenticOnly
- Boolean
When true, the route only fires for agentic turns.
Returns
The configured agent application.
Applies to
OnTeamsEvent(AgentApplication, Regex, TeamsRouteHandler, UInt16, String[], Boolean)
Registers a Teams event handler for event names that match the supplied pattern.
public static Microsoft.Agents.Builder.App.AgentApplication OnTeamsEvent(this Microsoft.Agents.Builder.App.AgentApplication app, System.Text.RegularExpressions.Regex namePattern, Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default, bool isAgenticOnly = false);
static member OnTeamsEvent : Microsoft.Agents.Builder.App.AgentApplication * System.Text.RegularExpressions.Regex * Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler * uint16 * string[] * bool -> Microsoft.Agents.Builder.App.AgentApplication
<Extension()>
Public Function OnTeamsEvent (app As AgentApplication, namePattern As Regex, handler As TeamsRouteHandler, Optional rank As UShort = 32767, Optional autoSignInHandlers As String() = Nothing, Optional isAgenticOnly As Boolean = false) As AgentApplication
Parameters
- app
- AgentApplication
The agent application to configure.
- namePattern
- Regex
The regular expression used to match event names.
- handler
- TeamsRouteHandler
The Teams-aware handler to invoke.
- rank
- UInt16
The route evaluation order. Lower values run first.
- autoSignInHandlers
- String[]
The OAuth sign-in handlers to associate with the route.
- isAgenticOnly
- Boolean
When true, the route only fires for agentic turns.
Returns
The configured agent application.