Language

MessageExtension.OnFetchAction Method

Definition

Overloads

Name Description
OnFetchAction(String, FetchActionHandler, String[], UInt16)

Registers a handler to process the initial fetch task for an Action based message extension.

OnFetchAction(Regex, FetchActionHandler, String[], UInt16)

Registers a handler to process the initial fetch task for an Action based message extension.

OnFetchAction(String, FetchActionHandler, String[], UInt16)

Registers a handler to process the initial fetch task for an Action based message extension.

public Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension OnFetchAction(string commandId, Microsoft.Agents.Extensions.MSTeams.MessageExtensions.FetchActionHandler handler, string[] autoSignInHandlers = default, ushort rank = 32767);
member this.OnFetchAction : string * Microsoft.Agents.Extensions.MSTeams.MessageExtensions.FetchActionHandler * string[] * uint16 -> Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension
Public Function OnFetchAction (commandId As String, handler As FetchActionHandler, Optional autoSignInHandlers As String() = Nothing, Optional rank As UShort = 32767) As MessageExtension

Parameters

commandId
String

ID of the commands to register the handler for.

handler
FetchActionHandler

Function to call when the command is received.

autoSignInHandlers
String[]

OAuth sign-in handler names for automatic sign-in before the route handler is invoked. Specify null to skip automatic sign-in.

rank
UInt16

Route evaluation order. Lower values run first. Defaults to Unspecified.

Returns

The application instance for chaining purposes.

Remarks

``` TeamsExtension.MessageExtensions.OnFetchAction("myCommand", (ctx, state, ct) => Task.FromResult(new ActionResponse { Task = new TaskInfo { Type = TaskInfoType.Continue, Value = new TaskModuleTaskInfo { Title = "My Form", Height = 300, Width = 400, Url = "https://example.com/form" } } })); ``` Alternatively, the TeamsFetchActionRouteAttribute can be used to decorate a FetchActionHandler method for the same purpose.

Applies to

OnFetchAction(Regex, FetchActionHandler, String[], UInt16)

Registers a handler to process the initial fetch task for an Action based message extension.

public Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension OnFetchAction(System.Text.RegularExpressions.Regex commandIdPattern, Microsoft.Agents.Extensions.MSTeams.MessageExtensions.FetchActionHandler handler, string[] autoSignInHandlers = default, ushort rank = 32767);
member this.OnFetchAction : System.Text.RegularExpressions.Regex * Microsoft.Agents.Extensions.MSTeams.MessageExtensions.FetchActionHandler * string[] * uint16 -> Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension
Public Function OnFetchAction (commandIdPattern As Regex, handler As FetchActionHandler, Optional autoSignInHandlers As String() = Nothing, Optional rank As UShort = 32767) As MessageExtension

Parameters

commandIdPattern
Regex

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

handler
FetchActionHandler

Function to call when the command is received.

autoSignInHandlers
String[]

OAuth sign-in handler names for automatic sign-in before the route handler is invoked. Specify null to skip automatic sign-in.

rank
UInt16

Route evaluation order. Lower values run first. Defaults to Unspecified.

Returns

The application instance for chaining purposes.

Remarks

Alternatively, the TeamsFetchActionRouteAttribute can be used to decorate a FetchActionHandler method for the same purpose.

Applies to