Language

TeamsAppExtensions.OnTeamsMessage Method

Definition

Overloads

Name Description
OnTeamsMessage(AgentApplication, String, TeamsRouteHandler, UInt16, String[], Boolean)

Registers a Teams message handler for the specified message text.

OnTeamsMessage(AgentApplication, Regex, TeamsRouteHandler, UInt16, String[], Boolean)

Registers a Teams message handler for message text that matches the supplied pattern.

OnTeamsMessage(AgentApplication, String, TeamsRouteHandler, UInt16, String[], Boolean)

Registers a Teams message handler for the specified message text.

public static Microsoft.Agents.Builder.App.AgentApplication OnTeamsMessage(this Microsoft.Agents.Builder.App.AgentApplication app, string text, Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default, bool isAgenticOnly = false);
static member OnTeamsMessage : Microsoft.Agents.Builder.App.AgentApplication * string * Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler * uint16 * string[] * bool -> Microsoft.Agents.Builder.App.AgentApplication
<Extension()>
Public Function OnTeamsMessage (app As AgentApplication, text 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.

text
String

The exact message text 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

OnTeamsMessage(AgentApplication, Regex, TeamsRouteHandler, UInt16, String[], Boolean)

Registers a Teams message handler for message text that matches the supplied pattern.

public static Microsoft.Agents.Builder.App.AgentApplication OnTeamsMessage(this Microsoft.Agents.Builder.App.AgentApplication app, System.Text.RegularExpressions.Regex textPattern, Microsoft.Agents.Extensions.MSTeams.App.TeamsRouteHandler handler, ushort rank = 32767, string[] autoSignInHandlers = default, bool isAgenticOnly = false);
static member OnTeamsMessage : 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 OnTeamsMessage (app As AgentApplication, textPattern 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.

textPattern
Regex

The regular expression used to match message text.

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