Language

TeamsChannelUpdateRouteAttribute Class

Definition

Attribute to define a route that handles any Teams channel update event.

[Microsoft.Agents.Builder.App.RouteHandlerType(typeof(Microsoft.Agents.Extensions.MSTeams.Channels.ChannelUpdateHandler))]
[System.AttributeUsage(System.AttributeTargets.Method, Inherited=true)]
public class TeamsChannelUpdateRouteAttribute : 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 TeamsChannelUpdateRouteAttribute = class
    inherit Attribute
    interface IRouteAttribute
Public Class TeamsChannelUpdateRouteAttribute
Inherits Attribute
Implements IRouteAttribute
Inheritance
TeamsChannelUpdateRouteAttribute
Attributes
Implements

Remarks

Decorate a method with this attribute to register it as a handler for all channel update events in Teams, including created, deleted, renamed, restored, shared, unshared, member added, and member removed. Use the specific event attributes (e.g., TeamsChannelCreatedRouteAttribute) to handle individual event types. The method must match the ChannelUpdateHandler delegate signature.

[TeamsChannelUpdateRoute]
public async Task OnAnyChannelEventAsync(ITeamsTurnContext turnContext, ITurnState turnState, Microsoft.Teams.Apps.Schema.TeamsChannel channel, CancellationToken cancellationToken)
{
    // Handle any channel update event
}

Alternatively, OnChannelEventReceived(ChannelUpdateHandler, String[], UInt16) can be used to register the handler via the fluent API.

Constructors

Name Description
TeamsChannelUpdateRouteAttribute(Boolean, UInt16, String)

Attribute to define a route that handles any Teams channel update event.

Methods

Name Description
AddRoute(AgentApplication, MethodInfo)

Registers a route for the specified method within the given agent application.

Applies to