MessageExtension.OnMessagePreviewEdit 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 |
|---|---|
| OnMessagePreviewEdit(String, MessagePreviewEditHandler, String[], UInt16) |
Registers a handler to process the 'edit' action of a message that's being previewed by the user prior to sending. |
| OnMessagePreviewEdit(Regex, MessagePreviewEditHandler, String[], UInt16) |
Registers a handler to process the 'edit' action of a message that's being previewed by the user prior to sending. |
OnMessagePreviewEdit(String, MessagePreviewEditHandler, String[], UInt16)
Registers a handler to process the 'edit' action of a message that's being previewed by the user prior to sending.
public Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension OnMessagePreviewEdit(string commandId, Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessagePreviewEditHandler handler, string[] autoSignInHandlers = default, ushort rank = 32767);
member this.OnMessagePreviewEdit : string * Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessagePreviewEditHandler * string[] * uint16 -> Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension
Public Function OnMessagePreviewEdit (commandId As String, handler As MessagePreviewEditHandler, Optional autoSignInHandlers As String() = Nothing, Optional rank As UShort = 32767) As MessageExtension
Parameters
- commandId
- String
ID of the command to register the handler for.
- handler
- MessagePreviewEditHandler
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.OnMessagePreviewEdit("composeCmd", (ctx, state, preview, ct) => { var draft = preview.Attachments?.FirstOrDefault()?.Content; return Task.FromResult(new Response { ComposeExtension = new Result { Type = ResultType.List, Attachments = [BuildEditCard(draft)] } }); }); ``` Alternatively, the TeamsMessagePreviewEditRouteAttribute can be used to decorate a MessagePreviewEditHandler method for the same purpose.
Applies to
OnMessagePreviewEdit(Regex, MessagePreviewEditHandler, String[], UInt16)
Registers a handler to process the 'edit' action of a message that's being previewed by the user prior to sending.
public Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension OnMessagePreviewEdit(System.Text.RegularExpressions.Regex commandIdPattern, Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessagePreviewEditHandler handler, string[] autoSignInHandlers = default, ushort rank = 32767);
member this.OnMessagePreviewEdit : System.Text.RegularExpressions.Regex * Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessagePreviewEditHandler * string[] * uint16 -> Microsoft.Agents.Extensions.MSTeams.MessageExtensions.MessageExtension
Public Function OnMessagePreviewEdit (commandIdPattern As Regex, handler As MessagePreviewEditHandler, Optional autoSignInHandlers As String() = Nothing, Optional rank As UShort = 32767) As MessageExtension
Parameters
- commandIdPattern
- Regex
Regular expression to match against the ID of the command to register the handler for.
- handler
- MessagePreviewEditHandler
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 TeamsMessagePreviewEditRouteAttribute can be used to decorate a MessagePreviewEditHandler method for the same purpose.