TeamsChannelRestoredRouteAttribute Class
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.
Attribute to define a route that handles Teams channel restored events.
[Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Channels.ChannelUpdateHandler))]
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public class TeamsChannelRestoredRouteAttribute : Attribute, Microsoft.Agents.Builder.App.IRouteAttribute
[<Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Channels.ChannelUpdateHandler))>]
[<System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)>]
type TeamsChannelRestoredRouteAttribute = class
inherit Attribute
interface IRouteAttribute
Public Class TeamsChannelRestoredRouteAttribute
Inherits Attribute
Implements IRouteAttribute
- Inheritance
-
TeamsChannelRestoredRouteAttribute
- Attributes
- Implements
Remarks
Decorate a method with this attribute to register it as a handler for channel restored events in Teams. The method must match the ChannelUpdateHandler delegate signature.
[TeamsChannelRestoredRoute]
public async Task OnChannelRestoredAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Apps.Schema.TeamsChannel channel, CancellationToken cancellationToken)
{
// Handle channel restored event
}
Alternatively, OnRestored(ChannelUpdateHandler, String[], UInt16) can be used to register the handler via the fluent API.
Constructors
| Name | Description |
|---|---|
| TeamsChannelRestoredRouteAttribute(Boolean, UInt16, String) |
Attribute to define a route that handles Teams channel restored events. |
Methods
| Name | Description |
|---|---|
| AddRoute(AgentApplication, MethodInfo) |
Registers a route for the specified method within the given agent application. |